How do I get Affected User into PowerShell?
Hello,
I am currently doing some testing with PSAs for future automations. I am able to get all my variables, except for Affected User. Can you please show me what I am doing wrong?
param($Parent_Guid)
$Parent_WI = Get-SCSMObject -id $Parent_Guid
$Color = $Parent_WI.CiresonARA02
$Title = $Parent_WI.Title
$Affected_User = $Parent_WI.AffectedUser
Best Answers
-
Shane_White Cireson Support Super IT Monkey ✭✭✭✭✭
Hello @Eric_Evans
Affected User is a relationship not a property on the object, so you need to get the relationship first and then get the affected user that way.
This blog series might help:
https://cireson.com/blog/definitive-service-manager-powershell-part-1-top-8-powershell-commands/
Thanks,
Shane
0 -
Shane_White Cireson Support Super IT Monkey ✭✭✭✭✭
No worries! once you get into the 3rd or 4th one I think is where you are going to get the bits you need!
It's a very useful guide though to get started in PowerShell so props to @Adam_Dzyacky for producing it!
0
Answers
Hello @Eric_Evans
Affected User is a relationship not a property on the object, so you need to get the relationship first and then get the affected user that way.
This blog series might help:
https://cireson.com/blog/definitive-service-manager-powershell-part-1-top-8-powershell-commands/
Thanks,
Shane
Pardon the ignorance, and that you very much. I will give this a read!
No worries! once you get into the 3rd or 4th one I think is where you are going to get the bits you need!
It's a very useful guide though to get started in PowerShell so props to @Adam_Dzyacky for producing it!