Tagged with script

How can I create / name a folder with today’s date?

This is very handy if you are using scripts to generate daily logs and would like to put them in a folder with the current date. You can, of course, tweak the commands to suit your requirements:   for /F “tokens=1-4 delims=/ ” %%A in (‘date /t’) do ( set DateDay=%%A set DateMonth=%%B set DateYear=%%C […]

How can I search for all users that have the “Network Policy” set to false using PowerShell ?

If you need to search Active Directory to find users who currently have the “Network Access Permission” set to “Deny Access” on the Dial-in tab of their user account run this Powershell command: Get-ADUser -Filter {(mail -like “*”) -and (ObjectClass -eq “user”)} -Properties msNPAllowDialin | Where { $_.msNPAllowDialin -match “False” } | fl Name, msNPAllowDialin […]