Custom Variable - Current Logged On User (for Dynamic Collections)
Hey @all,
I would like to use the current logged on user as a variable for Dynamic Collections.
A reason is that I would like to check if the current logged on user is part of the local administrators group on his logged on computer..
Do anyone know if this is somehow possible?
I am thankful for all answers.
Greeting,
Mazl
0
Comments
%username% should give you the current user.
$env:username if using PowerShell
Sorry I think I described my problem completly wrong. I would like to create a "Dynamic collection" and use the current logged on user of the computer as a variable.
The reason is that I want to create e.g. a Dynamic Collection that gives me all the computers where the logged on user is part of the local Administrators group.
Sorry I think I described my problem completly wrong. I would like to create a "Dynamic collection" and use the current logged on user of the computer as a variable.
The reason is that I want to create e.g. a Dynamic Collection that gives me all the computers where the logged on user is part of the local Administrators group.
The best way I can think of doing this is having a login script GPO, that runs a PowerShell script. This PowerShell script checks the current user against the members of the local admins and then imports that data into a custom field for that PC in Inventory.
If I get some time spare today, I'll have a play with PowerShell and see if I can get something working.
This works. It's probably not the best way of doing this.