Quantcast
Channel: Microsoft Identity Manager forum
Viewing all articles
Browse latest Browse all 7443

PowerShell MA: Cannot bind argument to parameter 'String' because it is null.

$
0
0

Hi,

I'm trying to get started with the PowerShell MA. I successfully installed the MA, and am trying to run the sample O365 scripts that were made available with the MA. I am able to successfully run the Import.ps1 script from the PowerShell ISE, and see my users in my O365 tenant, but when I try to run a Full Import on my PowerShell MA, it fails with "stopped-extensible-extension-error". In Event Viewer, I see a number of errors and warnings, one of which says "Cannot bind argument to parameter 'String' because it is null."

Any ideas? Thanks in advance. The full script is below (scrubbed):

param

(

$Username="admin@tenant.onmicrosoft.com",


$Password="password"


)



Import-Module

MSOnline-Force



$SecurePassword

=ConvertTo-SecureString$Password-AsPlainText-Force


$Creds

=New-ObjectSystem.Management.Automation.PSCredential$Username,$SecurePassword



Connect-MsolService

-Credential$Creds



$Threshold

=0



$users

=Get-MsolUser-MaxResults20000|Where-Object{($_.isLicensed)-and($_.UserPrincipalName-match'contoso.com$')}



if

($Users.Count-lt$Threshold)

{

throw"Less users than expected returned from MSOnline"


}



#Always pass objects as hash table in pipeline


foreach

($Userin$Users)

{

   

$obj=@{}

   

$obj.Add("Id",$User.UserPrincipalName)

   

$obj.Add("objectClass","user")

   

$obj.Add("IsLicensed",$User.IsLicensed)

   

$obj


}


Viewing all articles
Browse latest Browse all 7443

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>