This script connect to your VI Server, then retrieve all the virtual machine names and get the VMware tools status and version. Script: Connect-VIServer -Server VIServerName get-vm | % { get-view $_.ID } | select Name, @{ Name=”hostName”; Expression={$_.guest.hostName}}, @{
Get the virtual desktop uptime
Get the size of the Exchange databases
Get the number of mailboxes on each Exchange store
This script get the number of mailboxes on each Exchange store Script : Get-MailboxDatabase | Select-Object Name,@{Name=”Number of users”;Expression={(Get-Mailbox -Database $_.name).Count}}|Out-GridView Reference Get-MailboxDatabase This cmdlet is available only in on-premises Exchange Server 2013. Use the Get-MailboxDatabase cmdlet to retrieve one
Get the Exchange database statistics
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: “