mardi 11 juillet 2017

Update XML element attribute with value from csv file crossed references with wmi-object

This problem is a bit more complicate... In my previous post I asked about returning domain/username to csv file. (and thank you Mathias for quick response)

Now I need to update XML attribute with value from the csv file... while crossed-reference with wmi-object,username. My end goal is a logon script that change the value in the XML file with appropriate extension based on logon username.

Right now I am trying to write if-statement that will check if logonusername is equal to any entry of the csv table, then return with the extension. I am not sure where to begins actually.

If anyone can shed some light please do so. My idea right now is:

  1. get-aduser to csv with extension [done]
  2. add wmi-object>username to variable
  3. if-statement to look for the same variable(username) in csv table
  4. return variable with extension respective to the username
  5. update xml attribute with the new extension

Happy coding :)

Aucun commentaire:

Enregistrer un commentaire