Saturday, 24 February 2018

HOW TO REMOVE MULTIPLE SCOPE ON DHCP USING POWERSHELL


HOW TO REMOVE MULTIPLE SCOPE ON DHCP USING POWERSHELL


Hey all,

I accidentally created lots of scope by mistake !!
it was not possible to delete all of the scope physically so I used simple poweshell script to do my job.

Edit as you according to your needs

For ($i=1; $i-lt 255;$i++)
{
$i= $i + 1

$scpID = "192.$i.0.0"
Write-host $scpID 

Remove-dhcpserverv4scope -computername "youcomputername.domain.local" -scopeid $scpID

}



Edit the IPaddress range and your FQDN name.
Save the above on notepad using .ps1 extenstion.

Wednesday, 21 February 2018

GROUP POLICY TO LOCK USER SCREEN AFTER INACTIVITY (IDEAL TIME)

HOW TO : 

GROUP POLICY TO LOCK USER SCREEN AFTER INACTIVITY (IDEAL TIME)



Server:Windows Server 2012 
Client: Windows 7


Today one of my client asked me if their computer could be auto locked after certain amount of ideal time. So here is what I did to apply the settings.I have seen people using task scheduler and batch file to do this but I find this much more easier to apply.

FIX :


1. On your Domain Controller, Open Group Policy Management console 
( Windows + R and "gpmc.msc" )
2. Create Group policy using your desire name

3. Edit your policy
4. Navigate to User Configuration \ Policies \ Control panel \ Personalization 



5. Edit the following 4 settings

Enable screen saver - Enable
Password protect the screen saver - Enable
Screen saver time out - Enable, Your desire ideal period
Force specific screen saver - Enable , blank path

6. Apply the Group policy to your desire Organizational Unit

Good Luck !!