Quantcast
Channel: SharePoint – SharePointed
Viewing all articles
Browse latest Browse all 68

Add and Remove Shell Access in SharePoint Using PowerShell

$
0
0

How do you add or remove shell access on a web apps content databases?

This script will grant shell access to a user on all the content databases associated with a content database.

$contentDbs = Get-SPContentDatabase -WebApplication "http://yourSharePointWebApp.com/"

foreach($db in $contentDbs)
{
	Add-SPShellAdmin -UserName "domain\user"  -database $db
}

Remove shell access

$contentDbs = Get-SPContentDatabase -WebApplication "http://yourSharePointWebApp.com/"

foreach($db in $contentDbs)
{
	Remove-SPShellAdmin -UserName "domain\user"  -database $db
}

Viewing all articles
Browse latest Browse all 68

Trending Articles