How can I convert a primaryGroupId to a group name in a script?
@echo off
if {%2}=={} @echo Syntax: call GetPGID primaryGroupId GroupName&exit /b 1
set PGID="%TEMP%\%ComputerName%_%UserName%_GetPGID.tmp"
if not exist %PGID% ListGroupRID>%PGID%
set %2="Unknown"
for /f "Tokens=1*" %%f in ('findstr /C:%1 %PGID%') do if "%1" EQU "%%f" set %2=%%g
exit /b 0
Loading Comments ...
Comments
No comments have been added for this post.
You must be logged in to make a comment.