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!


Comments

Popular posts from this blog

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

"The following factors also affect the level of access for" user with excess permissions

Unknown server tag 'AdminControls:MigrationToolPromotionTip'. in Central Admin after installing SharePoint 2013 security update KB4482464