Is it possible to programmatically change the password used in the PWA connector?
In a perfect world, this connector would simply utilize one of the RunAs accounts (including creating a new one, of course), rather than requiring the manual entry of a username and password. But if that is not feasible, how can we manage this scenario with the existing constraints?
Comments
I don't have a project server to test this with in my lab (yet), but I would start by using SMLets to Get-SCSMConnector find the right connector and check the properties of that. To update, you need to save the connector object to a variable eg $PWAConnector, update that variable with new values and then use $PWAConnector | Update-SCSMConnector
Sorry I can't be of any more help for now but let me know how you get on.
Geoff
So for your second step in the process, I have not tried setting RunAsAccount yet, because it does not have any apparent properties of its own, like the RunAsAccounts that appear in the console, or the hidden MOM/SCOM accounts. It would seem that I just need to overwrite the whole object, but since it is null it suggests that this may not be where the username/password that I typed into the connector are stored.
I need to get a test ID into there before I start experimenting. Am I heading in the right direction, though?
You are heading in the direction I would be heading in, but that is no guarantee at all that it is the right direction
I'll do some more digging my end, see if I can come up with anything.
The RunAsAccount property should remain null. This does not grant access to the PWA server (although, to points I have made in other posts, it should) and setting the property with a valid RunAsAccount will corrupt the connector.
When working with the connector, it has a ConnectorObject property, which seems to store the properties specific to this type of connector. For example, if $obj is our connector, then $obj.ConnectorObject.GetProperties() will show you the following:
It is not clear to me that any of these properties (or children of them) represent the credentials used to connect to PWA, however.
Any other insight the team could provide on this?