Display if a local user is enabled or disabled

I'm trying to create a custom inventory rule to display the local users and their enabled status and then display this information in a report. I'm currently using WMIC but with it being discontinued this year I'm trying to find an equivalent in either Powershell or CMD  and I have the need to display if the account is enabled or not.

I'm currently using ShellCommandTextReturn(cmd.exe /c wmic useraccount where "localaccount=true" get name)

I'm trying to create this script with powershell since it displays all the information I need but it's not showing any information in KACE.  It works fine in Powershell.  ShellCommandTextReturn(powershell.exe get-LocalUser)

0 Comments   [ + ] Show comments

Answers (2)

Answer Summary:
Posted by: Mauricio Beltran 1 month ago
Senior White Belt

Top Answer

Hello jrodlivewire06,

Can you please try:

ShellCommandTextReturn(cmd /q /c cmd /q /c %SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe (get-LocalUser))

I have tried that one in my lab and it works. I used this KB from Quest support as a reference:


Best regards,


Posted by: jrodlivewire06 1 month ago
White Belt

That worked perfectly. Thank you!

This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ