📜 ⬆️ ⬇️

Moving from CMD to PowerShell: a guide to commands and cmdlets for administering AD

image
Windows administrators have long relied on time-tested command line tools like PING, IPCONFIG and REPADMIN. And some still use them, instead of turning their attention to PowerShell. Ashley McGlone , Premier Field Engineer Active Directory and PowerShell (you can see his smiling face in the photo), created a wonderful 4-page guide that relates the well-known CMD utilities for working with Active Directory to their corresponding PowerShell cmdlets. For example, instead of PING, you can use the PowerShell Test-Connection cmdlet, instead of NSLOOKUP - Resolve-DNSName, instead of GPUPDATE - Invoke-GPUpdate.

Many will ask the question: why is it, in fact, worth switching to PowerShell cmdlets? The author of the manual gives several reasons for this :
  1. The command line tools simply output text that requires parsing to work with it further. PowerShell allows you to transfer this data through the pipeline and work with them directly in the console or output to a file.
  2. Team availability. For example, if you remotely connect to the server via RDP, then adminpak.msi or the Windows Rerource Kit may not be installed on it. And PowerShell is on every Windows Sever 2008 R2 and higher machine.
  3. Same syntax. The syntax for different PowerShell cmdlets is similar.
  4. A large number of cmdlets for all occasions.

Considered CMD utilities and their corresponding PowerShell cmdlets


The following CMD utilities are in focus of the free tutorial:
  1. REPADMIN
  2. DCPROMO
  3. CSVDE
  4. NETDOM
  5. NLTEST
  6. GPUPDATE
  7. GPRESULT
  8. DSGET
  9. DSQUERY
  10. DSADD
  11. DSMOD
  12. DSRM
  13. DSMOVE
  14. DSACLS
  15. DNSCMD
  16. NSLOOKUP
  17. Ping
  18. Ipconfig
  19. NETSTAT

The manual itself is built on the following logic:
CMD - Switch - PowerShell cmdlet - PowerShell module - Windows Server Version.

Much attention is paid to the cmdlets that were presented in Windows Server 2012 and PowerShell v3.

You can download it on technet .

')

Source: https://habr.com/ru/post/169243/


All Articles