#### Get AD Schema version Get-ADObject(Get-ADRootDSE).schemaNamingContext-PropertyobjectVersion#### Get groups with extension attributeGet-ADGroup-Filter*-PropertiesextensionAttribute15|selectname,extensionAttribute15#### Set Extension Attributes for array $iforeach($iin$groups){Set-ADGroup$i-add@{extensionAttribute15="NoSync"}}#### Remove extension attribute from groupSet-ADGroup"groupname"-clear"extensionAttribute15"#### AutopilotSave-Script-NameGet-WindowsAutoPilotInfo-Pathc:\tempGet-WindowsAutoPilotInfo.ps1-OutputFilec:\temp\WindowsAutoPilotInfo.csv#### SharepointInstall-Module-NameMicrosoft.Online.SharePoint.PowerShell$SPAdminSite="https://contoso-admin.sharepoint.com"Connect-SPOService-Url$SPAdminSite#### Get All OneDrive SitesGet-SPOSite-IncludePersonalSite$true-Limitall-Filter"Url -like '-my.sharepoint.com/personal/"#### Remove Sharepoint / OneDrive SiteRemove-SPOSite-Identityhttps://contoso-my.sharepoint.com/personal/j_doe_contoso_com#### Grant permissions to another users OneDriveSet-SPOUser-Sitehttps://contoso-my.sharepoint.com/personal/j_doe_contoso_com-LoginNamefirstname.surname@contoso.com-IsSiteCollectionAdmin$false#### Exchange Powershell ModuleInstall-Module-NameExchangeOnlineManagement#### Azure ADGet-AzureADUser-all$true|where{$_.UserType-ne"Member"-and$_.UserState-ne"Accepted"}#### Azure AD – Users group membershipsGet-AzureADUser-Filter"UserPrincipalName eq 'firstname.surname@contoso.com'"|Get-AzureADUserMembership#### DNS Server copy secondary zonesGet-DnsServerZone-ComputerNameDNS1|Where{$_.ZoneType-eq"Secondary"}|Add-DnsServerSecondaryZone-ComputerNameDNS2#### Get a registry itemGet-ItemProperty-Path"HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\TSAppSrv\TSMSI"#### Get Members of distribution list and enumerate sender permissions$dist|selectName,RequireSenderAuthenticationEnabled,CustomAttribute7,@{Name='AcceptMessagesOnlyFromSendersOrMembers';Expression={$_.AcceptMessagesOnlyfromSendersOrMembers-join"/",","}}|Export-Csvc:\temp\Dist#### Get users default auth methodInstall-ModuleMSOnlineConnect-msolservice(Get-MsolUser-UserPrincipalNamefirstname.surname@contoso.com).StrongAuthenticationMethods#### Prefer IPv4#Check if IPv4 IP address is preferredping$env:COMPUTERNAME#If the reply is IPv6 address, run following registry setting to just prefer ipv4 and rebootNew-ItemProperty"HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\"-Name"DisabledComponents"-Value0x20-PropertyType"DWord"#If DisabledComponents exists, use the set cmdletSet-ItemProperty"HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\"-Name"DisabledComponents"-Value0x20#You need to reboot the computer in order for the changes to take effectRestart-Computer# From <https://msunified.net/2016/05/25/how-to-set-ipv4-as-preferred-ip-on-windows-server-using-powershell/>