The below PowerShell script will generate a CSV file that lists each replication subnet in Active Directory Sites and Services. The list includes the site associated with the subnet, and whether or not a domain controller is in the site. …
When working with multi-dimensional arrays like imported CSV data, sometimes you want to change one or more values in one of the rows. For example, you have imported user account data from a CSV file that uses an AD account’s …
You have a domain joined computer, and you want to add a domain user or domain group to one of the computer’s local groups. If you have administrative permissions on the domain joined computer, this can be done quickly with …
Some PowerShell commands to quickly add a Windows 2012 R2 server to an active directory domain in a lab environment. This includes configuring the NIC, renaming the server, and creating the AD computer account in a defined OU path. …
Some PowerShell commands to quickly build a Windows Server 2012 R2 DC for a new forest/domain in a lab environment. This includes some configuration changes to DNS, setting an external time source, building an OU structure, and creating administrative user accounts. …
I wanted a way to choose what my PowerShell session would connect to when starting up. At various times I need to connect to on-premises production systems, to lab systems, or to an Office 365 tenant. Editing my profile each …
List All Firewall Rules Get-netfirewallrule | FT name, displaygroup, action, direction, enabled -autosize Get Log File Location Get-netfirewallprofile | format-table name, enabled, logfilename -autosize Display a Single Rule’s Settings Show-NetFirewallRule | where name -eq “CoreNet-DHCP-In” Get-NetFirewallRule | where name …
The following PowerShell command will output the name and size of all folders in the current directory. It also includes the number of files in each of the folders. Get-ChildItem | Where-Object { $_.PsIsContainer } | Select-Object Name, @{ label=”Files”;Expression={ …
Use the following commands to list or search for specific ActiveSync devices. $Mailboxes = Get-Mailbox -Database <DBName> | Select Identity or $Mailboxes = Get-CasMailbox -ResultSize Unlimited | Select Identity Then $Devices = ForEach ($Mailbox in $Mailboxes) {Get-ActiveSyncDevice -Mailbox $Mailbox.Identity | …
Address Rewriting Order of Precedence Single Email Address Rewrite Domain Rewrite Domain Wildcard Rewrite Enable the Address Rewriting Agents Enable-TransportAgent -Identity “Address Rewriting Outbound agent” Enable-TransportAgent -Identity “Address Rewriting Inbound agent” Disable the Address Rewriting Agents Disable-TransportAgent -Identity …