Hello,
first of all, I am really new to PowerShell and by far no Techi.
I am more like the process management guy who likes to understand the basic ideas behind the technical solution.
So, the situation is as follows:
First database: Active Directory
- with the columns: user; office; place; ID (and many more, but this is not relevant yet).
-> This database is very well maintained and up to date. Size: 4500 user
Second database: SQL - database (showing all the hardware that is used)
- structure: computer name ; serial nr.; ID of the user; username; office; place; status of the computer (f.e. “used” or “sent” or “defect”)
-> This database is NOT very well maintained and NOT up to date in terms of office and place. Size: total of 30.000 computers, printers etc.
The goal is, to build an interface which updates the information of “username”, “office”, and “place” in the second database (SQL) based on the information from AD. The link should be the ID, because the ID is in both databases the same for each user.
So, the general idea is:
1.) with powershell there will be an export of AD into a .csv - file containing the following information:
ID; user; office; place
2.) there should be an import into the SQL database based on the ID.
I think and what I have heard so far, this is not quite an issue and possible to implement.
But now there is the issue that according to the information that is given in the column “status” in the sql database, the import should be differentiate. That means f.e. if the status is “defect”, than there is no import needed, instead the script should not be able to overwrite the columns “user”, “office”, and “place”.
If I am not mistaken, it is necessary to “read” the output of the column “status” first, before importing something.
What I am looking for now, is not a finished script, but rather an explanation which commands could/should be used and in which order.
I am thankful for any advice, tips etc.
Hopefully, I could make the situation anyhow understandable. If not, please tell me, which point is not clear and I will do my best to clarify it.
Thanks in advance!