Quickly load PowerShell (Snap-ins) modules

Most Microsoft products come with a Management Shell which is just PowerShell with their module loaded. What if you need access to an Active Directory cmdlet within the SharePoint Management Shell?  Easy enough. Load the Active Directory snap-in and your script can use commands from both.

Here's the alias for the Add-PSSnapin cmdlet: asnp

Easy to remember, right?

The syntax and remembering all the names of the snap-ins is cumbersome so I shortcut it:

PS C:\USERS\Greg> asnp *sh*

This loads the SharePoint snap-in in the least number of keystrokes

Here are some others:

  • asnp *acti*  (Active Directory)
  • asnp *serve* (Server Manager/Server Core modules)
  • asnp *sh* (SharePoint modules)
I use this all the time. Efficient!


Popular posts from this blog

ADMT fails to migrate SID History

Exchange 2010 event errors 2601, 2604, 2501

Robocopy Error 31 A device attached to the system is not functioning