OneIdentity / safeguard-ps

One Identity Safeguard PowerShell scripting resources
Apache License 2.0
22 stars 27 forks source link

Edit-SafeguardAsset #474

Closed imdroc closed 1 year ago

imdroc commented 1 year ago

Hi, we can't add a service account to an asset using edit-safeguardasset. we are always getting the same error. String: Edit-SafeguardAsset -AssetToEdit **** -ServiceAccountCredentialType DirectoryPassword -ServiceAccountDomainName **** -ServiceAccountName **** Error:

We know that the service account that we are using is correct. It's a domian account onboarded already into SPP

petrsnd commented 1 year ago

@imdroc We will try to reproduce this and get back to you.

imdroc commented 1 year ago

Hi @petrsnd any news? we still can't add the service accounts to the assets

petrsnd commented 1 year ago

@imdroc I have reproduced. The error you are seeing is coming back from SPP. I need to investigate further, because I think the request safeguard-ps is sending is wrong.

petrsnd commented 1 year ago

@imdroc This looks like an error in the safeguard-ps module. When you edit to set a directory account connection type you have to set the ConnectionProperties.ServiceAccountId property to a valid ID. Currently, the cmdlet is only setting ConnectionProperties.ServiceAccountDomainName and ConnectionProperties.ServiceAccountName. I need to fix the cmdlet to work properly, but in the meantime, a workaround would be to look up the account ID and pass it in on the command line.

PS> Edit-SafeguardAsset -AssetToEdit engdtopw01 -ServiceAccountCredentialType DirectoryPassword -ServiceAccountId 2
imdroc commented 1 year ago

It worked just fine now. Thanks