I have a script that is reading values from an Excel spreadsheet to create an Exchange 2007 Mailbox. After the mailbox is converted I use the Qwest tools to set additional user properties.
The script is successfully creating my users but I am unsuccessful in using Set-QADUser. When I pass the identity which is formed via the concatenation of two variables and then removing the space between them. The exact error I get is
I was encountering problems earlier because values I was passing were somehow not strings.
Here is how I am creating $dl
The output of Write-Host looks perfect and when I manually type the command in PowerShell with the same text it works to bind to the user object.
Does anyone have any ideas? This is my first attempt to really just use PowerShell and I am about to abandon it to get the job done and just use VBScript to create the users then fire off PowerShell to mail enable those users. Using PowerShell is my preference to force me to upgrade my skills though.
Any assistance would be most appreciated.
The script is successfully creating my users but I am unsuccessful in using Set-QADUser. When I pass the identity which is formed via the concatenation of two variables and then removing the space between them. The exact error I get is
Set-QADUser : The attribute syntax specified to the directory service is invalid. (Exception from HRESULT: 0x8007200B) At C:\Go\CreateUsers.ps1:97 char:13 + Set-QADUser <<<< -Identity $dl `
I was encountering problems earlier because values I was passing were somehow not strings.
Here is how I am creating $dl
Code:
$dl = ($Domain)+($Login)
$dl = [string] $dl.Replace(" ","")
Write-Host $dl
The output of Write-Host looks perfect and when I manually type the command in PowerShell with the same text it works to bind to the user object.
Does anyone have any ideas? This is my first attempt to really just use PowerShell and I am about to abandon it to get the job done and just use VBScript to create the users then fire off PowerShell to mail enable those users. Using PowerShell is my preference to force me to upgrade my skills though.
Any assistance would be most appreciated.