This script gets the following Exchange database statistics : Server name Database name The last full backup The number of mailboxes The database size The average mailbox size The database whitespace Script : function Get-DatabaseStatistics { $Databases = Get-MailboxDatabase -Status foreach($Database
Get the cluster quorum type
Get shared folder informations on a remote host
This script gets the shared folder informations and ACL configured on a remote host (source : http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/1903cfde-ad34-464e-9419-94d07ed9de88/) Script : Function Get-NtfsRights($name,$path,$comp){ $path = [regex]::Escape($path) $share = “\\$comp\$name” $path = $path -replace “\\ “,” ” $path $wmi = gwmi Win32_LogicalFileSecuritySetting -filter
Get OS information using WMI
Fill a host file (hosts.txt) with the hostnames you want to retrieve OS information Script : $Catalog = GC “C:\hosts.Txt” ForEach($Machine in $Catalog) {$QueryString = Gwmi Win32_OperatingSystem -Comp $Machine $QueryString = $QueryString.Caption Write-Host $Machine “:” $QueryString} My Powershell script categories
Get operating system name information using Active Directory
Get installed software list on a specific computer
This script gets the installed software list on a specific computer using WMI Script : $strComputer = “computer_hostname” $colItems = get-wmiobject -class “Win32_Product” -namespace “root\CIMV2” ` -computername $strComputer foreach ($objItem in $colItems) { write-host “Caption: ” $objItem.Caption write-host “Description: “
Get HP iLO board informations (XML reader)
Get hotfix list on remote host
This script gets the hotfix list installed on a remote system. I add a date filter to the result. Script : $strComputer = “remote_system_name” $hotfixlist = Get-HotFix -ComputerName $strComputer foreach ($hotfix in $hotfixlist) { if ($hotfix.psbase.properties[“installedOn”].Value -eq “10/28/2010”) { write-host
Get group members (ADSI method)
You can use this script to get group members in the Active Directory. It is based on the ADSI method Script $root=([ADSI]””).distinguishedName $Group = [ADSI](“LDAP://CN=Domain Admins, CN=Users,”+ $root) $Group.member My Powershell script categories Active Directory Cluster Database Exchange Files and