• Microsoft Exchange Server,  Windows Server

    Mail Tips, For Loops and Powershell

    Powershell gives Exchange admins a lot of nice little tricks to use. Exchange 2010 has a new feature in tool tips. You can use Powershell, to run a basic for loop, looping through a quick Get-Mailbox. Based on the output of the Get-Mailbox, you can get a list of all valid mailboxes for an organization. You can then execute a command, allowing you to run any mailbox command against every mailbox of an organization. In the following example, we’ll use the Set-MailBox to make a basic mail tip for all users: foreach ($mailbox in (Get-Mailbox)) { Set-MailBox -Identity $mailbox -MailTip “Please send only legitimate emails” }

  • Mac OS X,  Mac OS X Server,  Mac Security,  Mass Deployment,  Unix,  Windows Server,  Windows XP,  Xsan

    Lots of new stuff: Command Line Wiki Integration

    The Mac Commands page and the PowerShell Commands page are both now wikis and users with accounts on this site can edit them. Additionally I added a number of new pages worth of commands, FTP Commands, Windows Commands, Final Cut Server Commands, Amazon S3 Commands, Podcast Producer Commands and Xsan Commands; both of which are wikis as well.

  • Mac OS X,  VMware,  Xsan

    Scripting Compellent

    As with EMC, Compellent allows you to manage servers, volumes, server folders, volume folders, views, and of course mappings programatically. This provides the automation minded engineer with a full-on suite for managing their Compellent-based SAN. All of this is made possible using CompCU.jar. I keep a scripts folder and keep the jar file there, which can initially be downloaded from the Compellent site. Unlike a traditional shell script the scripts are to be placed into a text file and replayed against the SAN. If you are using VMware or Xen then you can combine the automation in Compellent along with the automation available with the command line interface for those…

  • Windows Server

    Show Logical Disks in Windows with PowerShell

    Quick & dirty, needed to loop through some servers to look at the logical volumes available on each. Using get-WmiObject you can query the available disks for Windows servers: get-WmiObject win32_logicaldisk There were a lot of servers, so then I realized I only cared about disks that were named a certain way. As with posix, you can pipe data, so I used where to constrain the output to those with names matching a certain disk name I was looking for: get-WmiObject win32_logicaldisk | where {$_.name -match “SomeName”} Isn’t server sprawl so much fun…

  • Active Directory,  Windows Server

    List Shares in Windows w/ PowerShell

    It is not uncommon to end up with a number of shares on a server, be it Windows, Mac OS X or Linux. With all of this sprawl it can be useful to see the shares in a quick and concise manner. using the Win32_Share WMI class through PowerShell you can do just that from the command line, similar to the sharing command in Mac OS X Server. The command, from PowerShell would be something similar to the following: get-WmiObject -class Win32_Share Assuming communication is working as intended, you can also query for the shares of other systems, by adding a -computer switch and specifying the host you’re listing shares…

  • Microsoft Exchange Server

    Exchange 2007: Change Default Domain with PowerShell

    Your users sick of typing in their domain name in the OWA auth screen?  Well, here’s the PowerShell command to make it where they don’t have to any more: Set-OWAVirtualDirectory -Identity “owa (default web site)” -LogonFormat username -DefaultDomain krypted.com  Since you’re not using https://krypted.com/ as your mail domain swap that out with your domain name of course.  And if you want to use it for the other virtual directories of OWA, such as Exadmin then run it again swapping out the owa with the VD you’re using.  Oh, you can do it through the Exchange Management Console too, but the GUI isn’t as much fun.  But if you do decide…

  • Windows Server

    Windows Server: Set Permissions Using PowerShell

      Set-acl Set Access Control List permissions from on a file (or object). Syntax Set-Acl [-path] string[] [-aclObject] ObjectSecurity [-filter string] [-Include String] [-Exclude String] [-passThru] [-whatIf] [-confirm] [CommonParameters] Key -Path path Path to the item to be changed {accepts wildcards} -aclObject ObjectSecurity An ACL with the desired property values. -filter string A filter in the provider's format or language. The exact syntax of the filter (wildcard support etc) depends on the provider. Filters are more efficient than -include/-exclude, because the provider applies the filter when retrieving the objects, rather than having PowerShell filter the objects after they are retrieved. -include string Include only the specified items from the Path.…