PowerShell Command Line Conversion Guide: Active Directory Edition
ACTIVE DIRECTORY CMD DCPROMO Switch PowerShell Cmdlet Install-ADDSForest Install-ADDSDomain Install-ADDSDomainController Uninstall-ADDSDomainController PowerShell Cmdlet Get-ADObject | Export-CSV Import-CSV | New-ADObject PowerShell Cmdlet Get-ADComputer Get-ADObject -LDAPFilter '(objectClass=contact)' Get-ADReplicationSubnet Get-ADGroup Get-ADOrganizationalUnit Get-ADReplicationSite Get-ADDomainController Get-ADUser Get-ADObject -SearchBase (Get-ADDomain).QuotasContainer -Filter * Get-ADObject -SearchBase (Get-ADForest).PartitionsContainer -LDAPFilter '(objectClass=crossRef)' PowerShell Cmdlet Get-ADComputer Search-ADAccount Get-ADObject -LDAPFilter '(objectClass=contact)' Get-ADReplicationSubnet Get-ADGroup Get-ADOrganizationalUnit Get-ADReplicationSite Get-ADDomainController Get-ADUser Search-ADAccount Get-ADObject -SearchBase (Get-ADDomain).QuotasContainer -Filter * Get-ADObject -SearchBase (Get-ADForest).PartitionsContainer -LDAPFilter '(objectClass=crossRef)' Get-ADObject PowerShell Cmdlet New-ADComputer New-ADObject -Type contact New-ADGroup New-ADOrganizationalUnit New-ADUser PowerShell Cmdlet Move-ADObject Rename-ADObject PowerShell Cmdlet Module ADDSDeployment Version 2012
CMD CSVDE CSVDE CMD DSGET DSGET DSGET DSGET DSGET DSGET DSGET DSGET DSGET DSGET CMD DSQUERY DSQUERY DSQUERY DSQUERY DSQUERY DSQUERY DSQUERY DSQUERY DSQUERY DSQUERY DSQUERY CMD DSADD DSADD DSADD DSADD DSADD DSADD CMD DSMOVE CMD
Switch i Switch computer contact subnet group ou site server user quota partition Switch computer contact subnet group ou site server user quota partition * Switch computer contact group ou user quota Switch
Module ActiveDirectory ActiveDirectory Module ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory Module ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory Module ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory Module ActiveDirectory Module
Version 2008 R2 2008 R2 Version 2008 R2 2008 R2 2012 2008 R2 2008 R2 2012 2008 R2 2008 R2 2008 R2 2008 R2 Version 2008 R2 2008 R2 2012 2008 R2 2008 R2 2012 2008 R2 2008 R2 2008 R2 2008 R2 2008 R2 Version 2008 R2 2008 R2 2008 R2 2008 R2 2008 R2 Version 2008 R2 Version
Switch
http://aka.ms/PsCmdGuideAD
v0.1
1 of 4
PowerShell Command Line Conversion Guide: Active Directory Edition
CMD DSMOD DSMOD DSMOD DSMOD DSMOD DSMOD DSMOD DSMOD CMD DSRM Switch computer contact group ou server user quota partition Switch PowerShell Cmdlet Set-ADComputer Set-ADObject Set-ADGroup Set-ADOrganizationalUnit Set-ADObject Set-ADUser Set-ADObject Set-ADObject PowerShell Cmdlet Remove-ADComputer Remove-ADGroup Remove-ADGroupMember Remove-ADUser Remove-ADOrganizationalUnit Remove-ADObject PowerShell Cmdlet Get-ACL Set-ACL PowerShell Cmdlet Get-ADReplicationFailure Get-ADReplicationQueueOperation Sync-ADObject Get-ADReplicationConnection Get-ADReplicationAttributeMetadata Get-ADReplicationPartnerMetadata Get-ADReplicationUpToDatenessVectorTable Set-ADReplicationSite Get-ADObject Set-ADObject Get-ADDomainControllerPasswordReplicationPolicy Add-ADDomainControllerPasswordReplicationPolicy Remove-ADDomainControllerPasswordReplicationPolicy Get-ADAccountResultantPasswordReplicationPolicy Get-ADDomainControllerPasswordReplicationPolicyUsage PowerShell Cmdlet Test-ComputerSecureChannel -Repair Test-ComputerSecureChannel Reset-ComputerMachinePassword Get-ADDomainController Get-ADDomain | Select-Object PDCEmulator Get-ADDomainController (Get-WMIObject Win32_ComputerSystem).Domain Get-ADTrust Stop-Computer PowerShell Cmdlet Module ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory Module ActiveDirectory Version 2008 R2 2008 R2 2008 R2 2008 R2 2008 R2 2008 R2 2008 R2 2008 R2 Version 2008 R2
CMD DSACLS CMD REPADMIN REPADMIN REPADMIN REPADMIN REPADMIN REPADMIN REPADMIN REPADMIN REPADMIN REPADMIN REPADMIN
Switch
Module Microsoft.PowerShell.Security Module ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory
Version 2008 R2 Version 2012 2012 2012 2012 2012 2012 2012 2012 2008 R2 2008 R2 2008 R2
Switch /FailCache /Queue /ReplSingleObj /ShowConn /ShowObjMeta /ReplSummary /ShowUTDVec /SiteOptions /ShowAttr /SetAttr /PRP
CMD NLTEST NLTEST NLTEST NLTEST NLTEST NLTEST NLTEST NLTEST NLTEST CMD
Switch SC_RESET SC_VERIFY SC_CHANGE_PWD DCLIST DCNAME DSGETDC PARENTDOMAIN DOMAIN_TRUSTS SHUTDOWN Switch
Module Microsoft.PowerShell.Management Microsoft.PowerShell.Management Microsoft.PowerShell.Management ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory Microsoft.PowerShell.Management Module
Version 2012 2012 2012 2008 R2 2008 R2 2008 R2 2012 2008 R2 Version
http://aka.ms/PsCmdGuideAD
v0.1
2 of 4
PowerShell Command Line Conversion Guide: Active Directory Edition
CMD NETDOM NETDOM NETDOM NETDOM NETDOM NETDOM NETDOM NETDOM NETDOM NETDOM NETDOM NETDOM NETDOM NETDOM NETDOM NETDOM CMD GPUPDATE GPRESULT CMD Switch ADD COMPUTERNAME JOIN MOVE RESETPWD REMOVE RENAMECOMPUTER RESET VERIFY QUERY WORKSTATION QUERY SERVER QUERY DC QUERY OU QUERY PDC QUERY FSMO QUERY TRUST Switch PowerShell Cmdlet Add-Computer Rename-Computer Add-Computer Add-Computer Reset-ComputerMachinePassword Remove-Computer Rename-Computer Test-ComputerSecureChannel -Repair Test-ComputerSecureChannel Get-ADComputer -Filter "operatingSystem -notlike '*server*'" Get-ADComputer -Filter "operatingSystem -like '*server*'" Get-ADDomainController Get-ADOrganizationalUnit Get-ADDomain | Select-Object PDCEmulator Get-ADForest | Select-Object DomainNamingMaster, SchemaMaster Get-ADDomain | Select-Object InfrastructureMaster, PDCEmulator, RIDMaster Get-ADTrust PowerShell Cmdlet Invoke-GPUpdate Get-GPResultantSetOfPolicy PowerShell Cmdlet Module Microsoft.PowerShell.Management Microsoft.PowerShell.Management Microsoft.PowerShell.Management Microsoft.PowerShell.Management Microsoft.PowerShell.Management Microsoft.PowerShell.Management Microsoft.PowerShell.Management Microsoft.PowerShell.Management Microsoft.PowerShell.Management ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory ActiveDirectory Module GroupPolicy GroupPolicy Module Version 2012 2012 2012 2012 2012 2012 2012 2012 2012 2008 R2 2008 R2 2008 R2 2008 R2 2008 R2 2008 R2 2012 Version 2012 2008 R2 Version
Switch
IP CMD PING CMD IPCONFIG IPCONFIG IPCONFIG IPCONFIG IPCONFIG CMD NETSTAT NETSTAT CMD Switch Switch /ALL /FLUSHDNS /DISPLAYDNS /REGISTERDNS Switch a r Switch PowerShell Cmdlet Test-Connection PowerShell Cmdlet Get-NetIPConfiguration Get-NetIPConfiguration -Detailed Clear-DnsClientCache Get-DnsClientCashe Register-DnsClient PowerShell Cmdlet Get-NetTCPConnection Get-NetRoute PowerShell Cmdlet Module Microsoft.PowerShell.Management Module NetTCPIP NetTCPIP DnsClient DnsClient DnsClient Module NetTCPIP NetTCPIP Module Version 2008 R2 Version 2012 2012 2012 2012 2012 Version 2012 2012 Version
DNS CMD NSLOOKUP CMD Switch Switch PowerShell Cmdlet Resolve-DNSName PowerShell Cmdlet Module DNSClient Module Version 2012 Version
http://aka.ms/PsCmdGuideAD
v0.1
3 of 4
PowerShell Command Line Conversion Guide: Active Directory Edition
CMD DNSCMD DNSCMD DNSCMD DNSCMD DNSCMD DNSCMD DNSCMD Switch /Info /Config /EnumZones /Statistics /ClearCache /StartScavenging /ResetForwarders PowerShell Cmdlet Get-DnsServer Set-DnsServer Get-DnsServerZone Get-DnsServerStatistics Clear-DnsServerStatistics Clear-DnsServerCache Start-DnsServerScavenging Get-DnsServerForwarder Set-DnsServerForwarder Add-DnsServerForwarder Remove-DnsServerForwarder Set-DnsServerConditionalForwarderZone Add-DnsServerConditionalForwarderZone Get-DnsServerZone Add-DnsServerPrimaryZone Add-DnsServerSecondaryZone Add-DnsServerStubZone Remove-DnsServerZone Get-DnsServerScavenging Set-DnsServerScavenging Set-DnsServerSecondaryZone Export-DnsServerZone Add-DnsServerResourceRecord Add-DnsServerResourceRecordA Add-DnsServerResourceRecordAAAA Add-DnsServerResourceRecordCName Add-DnsServerResourceRecordDS Add-DnsServerResourceRecordMX Add-DnsServerResourceRecordPtr Remove-DnsServerResourceRecord Set-DnsServerResourceRecordAging Get-DnsServerResourceRecord Add-DnsServerTrustAnchor Remove-DnsServerTrustAnchor Get-DnsServerTrustAnchor PowerShell Cmdlet Module DNSServer DNSServer DNSServer DNSServer DNSServer DNSServer DNSServer Version 2012 2012 2012 2012 2012 2012 2012
DNSCMD DNSCMD
/ZoneInfo /ZoneAdd
DNSServer DNSServer
2012 2012
DNSCMD DNSCMD DNSCMD DNSCMD DNSCMD
/ZoneDelete /ZoneResetScavengeServers /ZoneResetMasters /ZoneExport /RecordAdd
DNSServer DNSServer DNSServer DNSServer DNSServer
2012 2012 2012 2012 2012
DNSCMD DNSCMD DNSCMD DNSCMD DNSCMD DNSCMD CMD
/RecordDelete /AgeAllRecords /ZonePrint /TrustAnchorAdd /TrustAnchorDelete /EnumTrustAnchors Switch
DNSServer DNSServer DNSServer DNSServer DNSServer DNSServer Module
2012 2012 2012 2012 2012 2012 Version
DISCLAIMER
This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute the object code form of the Sample Code, provided that You agree: (i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded; (ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits, including attorneys fees, that arise or result from the use or distribution of the Sample Code. This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm.
http://aka.ms/PsCmdGuideAD
v0.1
4 of 4