Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Enable Onedrive account- Give admin permissions to their manager

$
0
0

I currently have this –

$adminUPN=”account@domain.com” $orgName=”domainname” $userCredential = Get-Credential -UserName $adminUPN -Message “Type the password.” Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential Get-SPOdeletedsite -IncludePersonalSite | fl (I can add URL to make it only the URL’s)

So this gets me a list of deleted personal Sharepoint accounts and URL’s

I also have a list of commands that I can run manually and input the URL that is created from the SP object. I am trying to automate the whole thing with a get- command so that I can get the URL list, have an input box open that I can put the URL into, keep it as a $variable and then restore the SPOobject and set the users manager as the new admin for that SPO(Onedrive).

I hope that makes sense.

I have these commands to do all this but I am trying to figure out how to automate it,

restore-SPODeletedSite -identity https://user-my.sharepoint.com/personal/user_name_com/

Set-SPOUser -site https://user-my.sharepoint.com/personal/user_name_com/ -LoginName admin@domain.com -IsSiteCollentionAdmin $true

I am a self taught Newb so any help would be appreciated.

submitted by /u/exhaltedyou13
[link] [comments]

The post Enable Onedrive account- Give admin permissions to their manager appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Trending Articles