How to Use PowerShell to Automatically Assign Licenses to Your Office 365 Users

I'm trying to setup a PowerShell script to automate the licensing in Office 365.  I'm working from the following link as my base and have made no modifications from the original posted content:

http://social.technet.microsoft.com/wiki/contents/articles/15905.how-to-use-powershell-to-automatically-assign-licenses-to-your-office-365-users.aspx?PageIndex=1

Once I run setupscript.ps1, I get the following error:

Exception calling "FindAll" with "0" argument(s): "Unknown error (0x80005000)"
At C:\scripts\SetupScript.ps1:261 char:1
+ $results=$searcher.FindAll()

Can anyone advise me how to resolve this?

May 13th, 2015 2:02pm

Hi,

I'm not familiar with PowerShell and we don't provide suggestions about it in this forum.

Maybe you can post the question in the Windows PowerShell forum below and ask if the experts there can provide any good suggestion for you:

https://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverpowershell

Regards,

Melon Chen
TechNet Community Su

Free Windows Admin Tool Kit Click here and download it now
May 14th, 2015 5:57am

0x80005000 ("The specified directory service attribute or value does not exist")

Did you follow the setup instructions to download and install MOSSIA and AAD (MSFT Online Powershell) module ?
Were you prompted to login to your tenant, before the error occurred?

https://support.office.com/en-gb/article/Windows-PowerShell-cmdlets-for-Office-365-06a743bb-ceb6-49a9-a61d-db4ffdf54fa6

May 14th, 2015 6:31am

@DonPick

Yes, I have those components installed, and yes, I get prompted to login for the tenant (and it completes successfully).

Free Windows Admin Tool Kit Click here and download it now
May 19th, 2015 10:54am

This article may be helpful:
http://community.office365.com/en-us/w/diagnostic_tools/default.aspx?ss-src=quicksearch#windowsazureactivedirectorymoduleforwindowspowershell

The dedicated Office365 community is likely more useful to you, for the hosted/service/AAD aspects (this forum here is mainly for the client software bits).

Or as suggested earlier, maybe a scripting forum (where script expertise/experience might assist you with the diagnosis of your error).

May 19th, 2015 5:37pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics