Wikipedia sudo is a program for Unix-like computer operating systems that allows users to run programs with the security privileges of another user, by default the superuser. It originally stood for “superuser do” as the older versions of sudo were
List DNS conditional forwarders Active Directory forest wide
How to count the mailboxes on each Exchange store
This script counts 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
Get statistics on Microsoft Exchange databases
Get the cluster quorum type
Get operating system information using WMI
Fill a host file (hosts.txt) with the hostnames you want to retrieve the operating system information Script : $Catalog = GC “C:\hosts.Txt” ForEach($Machine in $Catalog){ $QueryString = Gwmi Win32_OperatingSystem -Comp $Machine $QueryString = $QueryString.Caption Write-Host $Machine “:” $QueryString } Reference
Get HP iLO board informations using XML
List the installed softwares remotely using WMI
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 hotfix list remotely
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
Different ways of getting AD group members
I will show you, in the scripts below, different ways of getting Active Directorw group members with Powershell. Scripts ADSI method $root=([ADSI]””).distinguishedName $Group = [ADSI](“LDAP://CN=Domain Admins, CN=Users,”+ $root) $Group.member Get-ADGroupMember cmdlet $root = (get-ADDomain).Distinguishedname $group = “CN=Domain Admins, CN=Users,”+$root (Get-ADGroupMember