Trying to get output of dsregcmd /status
Hi
I want to run a script or custom inventory rule, or something that would be able to get the output of dsregcmd /status on the machines, but when I try to set it as a script, it doesn't seem like it is able to run for some reason, and also as a custom inventory rule, it seems it was not able to get any output either.
Has anyone here ever tried this? And how were you able to get the output?
Answers (1)
Hi. Use Powershell and pipe the output to Select-String cmdlet.
Simple example (run within powershell):
dsregcmd /status | Select-String -Pattern "IsUserAzureAd"
If you pack it into foreach statement with list of machines and sprinkle desired output titles in text file after -Pattern, than you might just end up with what you need. Next you could put the output into variables, append each iteration to csv file and generate a nice report in Excel to get the managers attention for a few seconds :)