New-CMDB User creates user without SMTP notification (email)#477
New-CMDB User creates user without SMTP notification (email)#477pwahlmueller wants to merge 2 commits into
Conversation
|
I feel like you are onto something here by forcing the ID to be unique with a GUID. But the thing is, I can't reproduce the scenario you're referring to above as the ID I'm seeing is still unique with the domain name + username. I copied the New-CMDBUser function out, introduced a Write-Host for the $newID variable, and then ran it with both examples. In which case, that arguably becomes a question of "how is the email not being found which leads to incorrectly calling New-CMDBUser." I'm genuinely not sure if that's the issue as this whole thing has been hard to pin down. The last thing I recall in this space was the update made to Get-SCSMUserByEmailAddress wherein SMLets was incorrectly evaluating hyphens in email addresses. In any case, the only way I can produce an error is if I don't delete those users from SCSM, and then run the example again. In which case, duplicate users are created with empty Notification Channels. Note: Ignore the Problems 1 in the above screenshot. I have a few things open 😄 |
|
You are completly right, the id would be unique with domain name + username. But I can do a script in my test environment to double check it and provide it here, if this helps. |
Are you referring to the following line in New-CMDBUser? or somewhere else?
Sure. So add the two users via script and then?
Like I said, I am strongly inclined to agree with you here on this change. I just want to see it for myself is all 😁 but if you can validate that's helpful as well 👍 |

Since the SMTP notification was not in all cases unique, I added
a. the domain
b. a guid (to be absolute on the safe side)
And I added error handling in case, somthing still fails.
Here in addition the scenario, which fails: