Yearly Archives: 2015

Edit an Group Policy object

If you receive this warning in Group Policy Management, when you are trying to edit an Group policy object:

Failed to open the Group Policy Object. You may not have appropriate rights.

Details:
The system cannot find the path specified.

This warning can happen, when one of the following folders are missing:
  • %SystemRoot%\Sysvol\Sysvol\DomainName
  • %SystemRoot%\Sysvol\Sysvol\DomainName\Policies
  • %SystemRoot%\Sysvol\Sysvol\DomainName\Policies\{GUID}
  • %SystemRoot%\Sysvol\Sysvol\DomainName\Policies\{GUID}\Machine
  • %SystemRoot%\Sysvol\Sysvol\DomainName\Policies\{GUID}\User

In my case, I was missing the Machine folder. I just created that folder, and then i could edit the object again.

Deny Dropbox from running with GPO

Start Group Policy Management Editor
Go to:
Computer Configuration\Policies\Windows Settings\Security Settings\Software Restriction Policies

If you see:

Dropbox1

On the right screen, then you need to right click on Software Restriction Policies, and choice “New Software Restricition Policies” first.

Right click on
Additional Rules, and choice “New Path Rule…”

Path should be:
%AppData%\Dropbox\bin\*.exe
Set security level to Disallowed
Dropbox2

Make a another new Path rule, and set path to:
%AppData%\Roaming\Dropbox\bin\*.exe

Set security level to Disallowed

To update GPO right away:
Run CMD as Administrator, and type: gpupdate /force
Dropbox3

This will update the group policy on the machine this command is run at.

Get a list of all VM in a cluster, that dosen’t hve Limit CPU For migration set to true

Get a list of all VM in a cluster, that dosen’t hve Limit CPU For migration set to true:

Import-Module -Name "virtualmachinemanager"
Get-Vmmserver localhost
$hc = Get-VMHostCluster -Name CLUSTERNMAE
$hosts =get-vmhost -VMHostCluster $hc
foreach($h in $hosts) {
	get-vm -vmhost $h |Where { $_.LimitCPUForMigration –eq $FALSE } | select Name
}

 

Shring SQL log file

USE [TestDb]
GO
ALTER DATABASE [TestDb] SET RECOVERY SIMPLE WITH NO_WAIT
DBCC SHRINKFILE([TestDb_Log], 1)
ALTER DATABASE [TestDb] SET RECOVERY FULL WITH NO_WAIT
GO

 

Where TestDB, is the database name, and TestDB_Log is the SQL Log file name.