namerg
asked on
How to read/query Active Directory in real time without being read by a variable
If i query AD and add all the information on variable $ad, the contents are in memory and not a realtime stage.
So, if i do modify properties of an AD user, all those modification are done through $ad via Set-ADUser.
In every property change i prompt "are you sure about the change of this for that?" and give the opportunity of changing more properties of the same user by asking for it.
But, if i typed a wrong last name and the time comes to ask "are you sure about the change of this for that" $ad has the old value not the new value. Is there anyway to query AD in real time?
<code>
$ad = Get-ADUser -filter * -Properties sAMAccountName,sn,givenNam e,departme nt,title,t elephoneNu mber,emplo yeeID,empl oyeeNumber -SearchBase "OU=ou,DC=domain,DC=com" | Select-Object sAMAccountName,sn,givenNam e,departme nt,title,t elephoneNu mber,emplo yeeID,empl oyeeNumber
</code>
Thanks for your help,
So, if i do modify properties of an AD user, all those modification are done through $ad via Set-ADUser.
In every property change i prompt "are you sure about the change of this for that?" and give the opportunity of changing more properties of the same user by asking for it.
But, if i typed a wrong last name and the time comes to ask "are you sure about the change of this for that" $ad has the old value not the new value. Is there anyway to query AD in real time?
<code>
$ad = Get-ADUser -filter * -Properties sAMAccountName,sn,givenNam
</code>
Thanks for your help,
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@Subsun,
Can you check the flowchart diagram in the bottom on this question https://www.experts-exchange.com/questions/27987781/Repetitive-Menu-in-Powershell.html
Let me know what you think.. thanks
Can you check the flowchart diagram in the bottom on this question https://www.experts-exchange.com/questions/27987781/Repetitive-Menu-in-Powershell.html
Let me know what you think.. thanks
ASKER