Download here: http://gg.gg/veq2h
*Group Policy Management Console Xp
*Group Policy Management Console Scripting Samples Download Free
*Open Group Policy Management Console
*Group Policy Management Software
*How To Access Group Policy
*Group Policy Management Console Sample Scripts Download-->
The following information describes the Group Policy Management Console (GPMC) scripting samples. These samples were originally found in the ’%programfiles%GpmcScripts’ directory after you installed the GPMC, and now can be found on the TechNet Code Gallery. You can execute the scripts at the command prompt. The scripts send output to the Command Prompt window. Run the scripts using the CScript.exe application.
The following script samples address administrative tasks:
There are also script samples that perform the following queries:Backing Up an Individual GPO
*GPMC simplifies the management of Group Policy by making it easier to understand, deploy, manage, and troubleshoot Group Policy implementations. GPMC also enables automation of Group Policy operations via scripting. GPMC can be used to manage Windows Server 2003 as well as Windows 2000-based Group Policy implementations.
*The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you.
If the DomainController switch is also not specified, the script will be run using an available domain controller in the domain of the user. For a brief description of the sample scripts, and an execution example, see Group Policy Management Console Scripting Samples. Download resources and applications for Windows 10, Windows 8, Windows 7. Group Policy Management Console Scripting Samples KevinSchultz-MS FT The following is a collection of Group Policy Management Console (GPMC) scripting samples.
The BackupGPO.wsf sample backs up a Group Policy object (GPO) to a specified backup directory. You can specify the GPO either by its name or by its GPO ID. The backup directory and the GPO must already exist. You can use the Comment parameter to specify an optional comment for the backup.
Usage: BackupGPO.wsf <GPO Name> <BackupLocation> [/Comment:<Comment>] [/Domain:<DNSDomainName>]
Example: BackupGPO.wsf TestPolicyGPO servershareGPOBackups /Comment: ’Weekly backup’ /Domain:example.microsoft.comBacking Up the GPOs in a Domain
The BackupAllGPOs.wsf sample backs up all the GPOs in a domain to the specified backup directory. The backup directory must exist. You can use the Comment parameter to specify an optional comment for the backup.
Usage: BackupAllGPOs.wsf <BackupLocation> [/Comment:<Comment>] [/Domain:<DNSDomain>]
Example: BackupAllGPOs.wsf servershareGPOBackups /Comment:’Weekly backup’ /Domain:example.microsoft.comCreating a Copy of a GPO
The CopyGPO.wsf sample creates a new GPO and copies the settings from a source GPO into the new destination GPO. You specify the source GPO either by its name or its GPO ID. You specify the new destination GPO by name. Use the MigrationTable switch to map security principals and paths across domains. Use the CopyACL switch to copy the access control list (ACL) on the source GPO to the destination GPO. To create a migration table, see the Create Migration Table script sample.
Usage: CopyGPO.wsf <SourceGPO> <TargetGPO> [/SourceDomain:<DNSDomainName>] [/TargetDomain:<DNSDomainName>] [/SourceDC:<DomainController>] [/TargetDC<DomainController>] [/MigrationTable<MigrationTable>] [/CopyACL]
Example: CopyGPO.wsf TestPolicyGPO NewProductionGPO /SourceDomain:example.microsoft.com /TargetDomain:example.microsoft.comCreating a New GPO
The CreateGPO.wsf sample creates a GPO with the specified name in the specified domain.
Usage: CreateGPO.wsf <GPOName> [/Domain:<DNSDomainName>]
Example: CreateGPO.wsf MyGPO /Domain:example.microsoft.comCreating a Policy Environment Using an XML File
The CreateEnvironmentFromXML.wsf sample reads an XML file that specifies a policy environment, such as an organizational unit (OU) or a GPO.
The script can perform operations such as the following:
*Create GPOs and OUs
*Link GPOs
*Import settings into GPOs
*Set security on GPOs
*Create security groups and users
Using the Undo switch deletes the environment. Specify the ExcludeSettings switch to ignore the GPO templates specified in the XML. Specify the ExcludePermissions switch to ignore the permissions on scopes of management (SOMs) and on GPOs. Default permissions will be used instead. To use a migration table when you import GPOs, specify the MigrationTable switch and the path of the migration table file. Use the MigrationTable switch to map security principals and paths across domains. For more information about how to create a migration table, see the CreateMigrationTable.wsf script sample. Specify the Q switch to enable quiet mode, which suppresses all the confirmation warnings.
Usage: CreateEnvironmentFromXML.wsf /xml:<XmlFile> [/undo] [/Domain:<DNSDomainName>] [/dc:<DomainControllerName>] [/ExcludeSettings] [/ExcludePermissions] [/MigrationTable:<FilePath>]
Example: CreateEnvironmentFromXML.wsf /xml:TestDomain.xml /Domain:/example.microsoft.com /dc:testdomaindc-1 /MigrationTable:TestMigrationTable.xmlCreating an XML File that Represents a Policy Environment
The CreateXMLFromEnvironment.wsf sample reads an existing policy environment; for example, OUs, GPOs, and GPO links. The sample script creates an XML file that represents that environment. You can use this script in conjunction with the CreateEnvironmentFromXML.wsf script. If you do not specify a domain, the domain of the computer is the default.
Multiple switches are available for this script. Use the ExcludePermissions switch so that policy-related permissions are not recorded. Use the StartingOU switch to specify the Lightweight Directory Access Protocol (LDAP) path of an OU from which the XML should be built, rather than parsing the entire domain. Specify the IncludeUsers switch to include user accounts. Use the IncludeAllGroups switch to include groups from the Users container and from the domain root. If you do not specify the IncludeAllGroups switch, the script adds only the groups defined in the OUs to the XML file. If you specify a template path, the GPOs are exported to the specified location. Use the /TemplatePath switch to specify the location in which you want to store the backups of the GPO templates that contain the policy settings.
Usage: CreateXMLFromEnvironment.wsf <OutputFile> [/Domain:<DNSDomainName>] [/dc:<DomainControllerName>] [/TemplatePath:<Path>] [/StartingOU:<LDAPPath>] [/ExcludePermissions] [/IncludeAllGroups] [/IncludeUsers]Group Policy Management Console Xp
Example: CreateXMLFromEnvironment.wsf TestDomain.xml /Domain:example.microsoft.com
Example: CreateXMLFromEnvironment.wsf TestDomain.xml /StartingOU:OU=marketing,DC=MyDomain,DC=COM
Example: CreateXMLFromEnvironment.wsf TestDomain.xml /templatepath:backupsCreate Migration Table
The CreateMigrationTable.wsf sample creates a file that contains the XML representation of the paths and the security principals for the specified GPO source.
You can specify one of the following GPO sources:
*An individual GPO
*A backup location
*All the GPOs in a domain
Then, you can use the resulting XML when you perform GPO import and copy operations, which are typically performed across domains.
You can use the following switches:
*Use the GPO switch to use a single GPO source when you build the XML migration table.
*Use the BackupLocation switch to use GPO backups as a source when you build the XML migration table.
*Use the AllGPOs switch to use all the GPOs in the domain as a source to build the XML migration table.
*Use the Overwrite switch to overwrite an existing XML file instead of appending to it.
*Use the MapByName switch to specify a corresponding account with the same name as the original in the destination domain.
Usage: CreateMigrationTable.wsf <TableName> [/GPO:<GPO Name>] [/BackupLocation:<FilePath>] [/AllGPOs] [/Overwrite] [/MapByName] [/Domain:<DNSDomainName>]
Example: CreateMigrationTable.wsf SampleTable.xml /BackupLocation:c:GPOBackups /OverWrite /MapByName
Example: CreateMigrationTable.wsf SampleTable.xml /GPO:TestGPO
20192020 season. Example: CreateMigrationTable.wsf SampleTable.xml /AllGPOs /Overwrite /Domain:example.microsoft.comDeleting a GPO
The DeleteGPO.wsf sample deletes a GPO. You can specify the GPO by name or by its GPO ID. If you do not specify the KeepLinks parameter, all the links to the GPO in the specified domain and in any sites are deleted.
Usage: DeleteGPO.wsf <GPOName> [/KeepLinks] [/Domain:<DNSDomainName>]
Example: DeleteGPO.wsf MyGPOGrant Permissions for all GPOs in a Domain
The GrantPermissionOnAllGPOs.wsf sample takes a particular domain and then grants a user or a group the specified level of permission for all the GPOs in that domain. This sample grants the specified level of permission regardless of whether those GPOs are linked to an OU or not. Use the Permission switch to specify a permission level of Read, Apply, Edit, FullEdit, or None for the security principal specified in the GroupName parameter. Use the Replace switch to remove existing permissions for the group or user before you make the change. If a group or a user is already granted a permission level that is higher than the new permission level, and you do not specify the Replace switch, no change is made.
Consider the following example:
*The new permission level is Edit
*The user already has Full Edit permission
In this example, if you do not use the Replace switch, the user retains the Full Edit permission because the change is not applied
Usage: GrantPermissionOnAllGPOs.wsf <Group Name> /Permission: <Permission Level> [/Replace] [/Domain:<DNSDomainName>]
Example: GrantPermissionOnAllGPOs.wsf ’Marketing Group Administrators’/Permission:FullEdit /Replace
Example: GrantPermissionOnAllGPOs.wsf TestUser /Permission:ReadGroup Policy Management Console Scripting Samples Download FreeImporting a GPO
The ImportGPO.wsf sample imports the settings from a backup GPO to another GPO that you specify. Use the BackupLocation parameter to specify the location of the backup. Then, use the BackupID parameter to specify the GPO name or backup ID (GUID) of the backup to use. If you do not specify a GPO, the name of the GPO that was backed up will be used.
If you specify a GPO name or a GPO ID for the BackupID parameter, the script imports the most recent backup. To import an earlier version of a GPO backup, specify the unique backup ID for the backup. The unique backup ID is the string that uniquely identifies the backup within its backup directory. To retrieve the unique backup IDs for all the GPOs in a specific backup location, run the QueryBackupLocation.wsf script.
Specify the GPO to which you are importing the setting by using the TargetGPO parameter. Use the optional MigrationTable switch when you import a GPO to map security principals and paths across domains. If the specified GPO does not exist, use the CreateIfNeeded switch to create a new GPO.
Usage: ImportGPO.wsf <BackupLocation> <BackupID> [TargetGPO] [/MigrationTable:<FilePath>] [/CreateIfNeeded] [/Domain:<DNSDomainName>]
Example: ImportGPO.wsf f:backup TestGPO NewGPO /CreateIfNeeded
Example: ImportGPO.wsf f:backup {73624CC9-E8F2-4F05-88D2-193FAE8773CE} NewGPO /CreateIfNeededImporting Multiple GPOs into a Domain
The ImportAllGPOs.wsf sample creates new GPOs in a specified domain and imports settings into these new GPOs from a specified backup location. The script creates a new GPO and imports settings for the latest version of each backed-up GPO in the backup location. The names of the GPOs that were backed up are used for the new GPOs. The new GPOs are derived from a previous GPO backup. Therefore, if the previous GPOs still exist in the domain, they will be overwritten by the new GPOs. Any GPO settings that have been changed since the backup will be lost.
Usage: ImportAllGPOs.wsf <BackupLocation> [/MigrationTable:<FilePath>] [Domain:<DNSDomainName>]
Example: ImportAllGPOs.wsf f:backup /MigrationTable:f:Table1.xmlRestoring a GPO
The RestoreGPO.wsf sample restores a backup GPO to the original domain from which it was saved. If the original domain is unavailable, the RestoreGPO.wsf sample fails. Use the BackupLocation parameter to specify the location of the backup. Then, use the BackupID parameter to specify the GPO name or the backup ID (GUID) of the backup to use.
If you specify a GPO name or a GPO ID for the Backup parameter, the script restores the most recent backup. To restore an earlier version of a GPO backup, specify the unique backup ID for the backup. The unique backup ID is the string that uniquely identifies the backup in its backup directory. To retrieve the unique backup IDs for all the GPOs in a backup location, run the QueryBackupLocation.wsf script.
Usage: RestoreGPO.wsf <BackupLocation> <BackupID> [/Domain:<Domain>] [/DC:<DomainController>]
Examples: RestoreGPO.wsf f:backup BackUpGPO
RestoreGPO.wsf f:backup {73624CC9-E8F2-4F05-88D2-193FAE8773CE}Restoring all GPOs in a Domain
The RestoreAllGPOs.wsf sample restores the most recent backup of each GPO that is backed up to Active Directory in a specified backup location.
Usage: RestoreAllGPOs.wsf <BackupLocation> [/Domain:<DNSDomainName>]
Examples: RestoreAllGPOs.wsf f:backup /Domain:example.microsoft.comSetting GPO Permissions
The SetGPOPermissions.wsf sample takes a GPO name or GPO ID, group or user name, and permission level and grants that level of permission on the GPO. Use the Permission switch to specify a permission level of Read, Apply, Edit, FullEdit, or None for the security principal that is specified in the GroupName parameter. Use the Replace switch to remove the existing permissions for the group or user before you make the change. Otherwise, the script ensures that the group or user has at least the specified permission level.
Usage: SetGPOPermissions.wsf:<GPOName><GroupName> /Permission:<PermissionLevel> [/Replace] [/Domain:<DNSDomainName>]
Example: SetGPOPermissions.wsf TestGPO TestGroup /Permission:Edit
Example: SetGPOPermissions.wsf TestGPO TestGroup /Permission:Edit
Example: SetGPOPermission.wsf {73624CC9-E8F2-4F05-88D2-193FAE8773CE}TestUser /Permission:FullEdit /Replace /Domain:example.microsoft.comSetting Permissions for All GPOs Linked to a Scope of Management
The SetGPOPermissionsBySOM.wsf sample grants a user or group a specified permission level for all the GPOs that are linked to a specified SOM (a site, a domain, or an OU). Use the Permission switch to specify a permission level of Read, Apply, Edit, FullEdit, or None for the security principal that is specified in the GroupName parameter. Use the Replace switch to remove existing permissions for the group or user before you make the change. If a group or a user has a permission level that is higher than the new permission level, and you do not specify the Replace switch, no change is made.
Consider the following example:
*The new permission level is Edit
*The user already has Full Edit permission
In this example, if you do not use the Replace switch, the user retains the Full Edit permission because the change is not applied. Use the Recursive switch to apply the change to all the child OUs of the specified SOM.
Usage: SetGPOPermissionsBySOM.wsf <SOM Name> <Group Name> /Permission: <PermissionLevel> [/Recursive] [/Replace] [/Domain:<DNSDomainName>]
Example: SetGPOPermissionsBySOM.wsf ’Marketing Group Administrators’ ’Marketing Group’ /Permission:FullEdit /Recursive
Example: SetGPOPermissionsBySOM.wsf MarketingOU TestUser /Permission:Read /ReplaceSetting Permissions to Create GPOs
The SetGPOCreationPermissions.wsf sample grants or removes the permissions that let a user or security group create GPOs in a domain.
Usage: SetGPOCreationPermissions.wsf <GroupName> [Remove] [/Domain:<DNSDomainName>]
Example: SetGPOCreationPermissions.wsf ’Policy Administrators’Open Group Policy Management Console
Example: SetGPOCreationPermissions.wsf TestUser /removeSetting Policy-related Permissions on a SOM
The SetSOMPermissions.wsf sample grants a user or group the specified level of permission on a specified SOM (a site, a domain, or an OU). Use the Permission switch to specify a permission level of LinkGPOs, RSoPLogging, RSoPPlanning, All, or None for the SOM. You can specify either the display name or the full LDAP path of the SOM for the SOM Name parameter. The Inherit switch causes all child containers to inherit the setting. RSoP planning mode requires, at least, a Windows Server domain controller to perform the query, and is not applicable to sites.
Usage: SetSOMPermissions.wsf <SOM Name> <Group Name> /Permission:<PermissionLevel> [/Inherit] [/Domain:<DNSDomainName>]
Example: SetSOMPermissions.wsf ’Test Marketing OU’ ’Marketing Admin Group’ /Permission:All /Inherit
Example: SetSOMPermission.wsf MarketingOU TestUser /Permission:LinkGPOsListing All GPOs in a Domain
The ListAllGPOs.wsf sample prints a list of all the GPOs in the specified domain.
Note
Using the /v switch creates detailed or verbose output for each GPO.
Usage: ListAllGPOs.wsf [/v] [/Domain:<DNSDomainName>]
Example: ListAllGPOs.wsf /v /Domain:example.microsoft.comListing Disabled GPOs
The FindDisabledGPOs.wsf sample prints a list of all the GPOs that are disabled or partially disabled in the specified domain. This script enumerates both fully and partially disabled GPOs. The results are grouped accordingly.
Usage: FindDisabledGPOs.wsf [/Domain:<DNSDomainName>]
Example: FindDisabledGPOs.wsf /Domain:example.microsoft.comListing GPO Information
The DumpGPOInfo.wsf sample prints information for a specified GPO. You can specify the GPO by its name or its GPO ID.
Usage: DumpGPOInfo.wsf GPOName [/Domain:<DNSDomainName>]
Example: DumpGPOInfo.wsf MyGPO /Domain:example.microsoft.comListing GPOs at a Backup Location
The QueryBackupLocation.wsf sample prints a list of the GPOs that have been backed up to a specified file system location. For each backed-up GPO, the Verbose switch displays detailed information, such as the ID, the backup time, and any comments.
Usage: QueryBackupLocation.wsf <path> [/Verbose]
Example: QueryBackupLocation.wsf servershareGPOBackups /VerboseListing GPOs by Policy Extension
The FindGPOsByPolicyExtension.wsf sample prints a list of all the GPOs in
https://diarynote-jp.indered.space
*Group Policy Management Console Xp
*Group Policy Management Console Scripting Samples Download Free
*Open Group Policy Management Console
*Group Policy Management Software
*How To Access Group Policy
*Group Policy Management Console Sample Scripts Download-->
The following information describes the Group Policy Management Console (GPMC) scripting samples. These samples were originally found in the ’%programfiles%GpmcScripts’ directory after you installed the GPMC, and now can be found on the TechNet Code Gallery. You can execute the scripts at the command prompt. The scripts send output to the Command Prompt window. Run the scripts using the CScript.exe application.
The following script samples address administrative tasks:
There are also script samples that perform the following queries:Backing Up an Individual GPO
*GPMC simplifies the management of Group Policy by making it easier to understand, deploy, manage, and troubleshoot Group Policy implementations. GPMC also enables automation of Group Policy operations via scripting. GPMC can be used to manage Windows Server 2003 as well as Windows 2000-based Group Policy implementations.
*The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you.
If the DomainController switch is also not specified, the script will be run using an available domain controller in the domain of the user. For a brief description of the sample scripts, and an execution example, see Group Policy Management Console Scripting Samples. Download resources and applications for Windows 10, Windows 8, Windows 7. Group Policy Management Console Scripting Samples KevinSchultz-MS FT The following is a collection of Group Policy Management Console (GPMC) scripting samples.
The BackupGPO.wsf sample backs up a Group Policy object (GPO) to a specified backup directory. You can specify the GPO either by its name or by its GPO ID. The backup directory and the GPO must already exist. You can use the Comment parameter to specify an optional comment for the backup.
Usage: BackupGPO.wsf <GPO Name> <BackupLocation> [/Comment:<Comment>] [/Domain:<DNSDomainName>]
Example: BackupGPO.wsf TestPolicyGPO servershareGPOBackups /Comment: ’Weekly backup’ /Domain:example.microsoft.comBacking Up the GPOs in a Domain
The BackupAllGPOs.wsf sample backs up all the GPOs in a domain to the specified backup directory. The backup directory must exist. You can use the Comment parameter to specify an optional comment for the backup.
Usage: BackupAllGPOs.wsf <BackupLocation> [/Comment:<Comment>] [/Domain:<DNSDomain>]
Example: BackupAllGPOs.wsf servershareGPOBackups /Comment:’Weekly backup’ /Domain:example.microsoft.comCreating a Copy of a GPO
The CopyGPO.wsf sample creates a new GPO and copies the settings from a source GPO into the new destination GPO. You specify the source GPO either by its name or its GPO ID. You specify the new destination GPO by name. Use the MigrationTable switch to map security principals and paths across domains. Use the CopyACL switch to copy the access control list (ACL) on the source GPO to the destination GPO. To create a migration table, see the Create Migration Table script sample.
Usage: CopyGPO.wsf <SourceGPO> <TargetGPO> [/SourceDomain:<DNSDomainName>] [/TargetDomain:<DNSDomainName>] [/SourceDC:<DomainController>] [/TargetDC<DomainController>] [/MigrationTable<MigrationTable>] [/CopyACL]
Example: CopyGPO.wsf TestPolicyGPO NewProductionGPO /SourceDomain:example.microsoft.com /TargetDomain:example.microsoft.comCreating a New GPO
The CreateGPO.wsf sample creates a GPO with the specified name in the specified domain.
Usage: CreateGPO.wsf <GPOName> [/Domain:<DNSDomainName>]
Example: CreateGPO.wsf MyGPO /Domain:example.microsoft.comCreating a Policy Environment Using an XML File
The CreateEnvironmentFromXML.wsf sample reads an XML file that specifies a policy environment, such as an organizational unit (OU) or a GPO.
The script can perform operations such as the following:
*Create GPOs and OUs
*Link GPOs
*Import settings into GPOs
*Set security on GPOs
*Create security groups and users
Using the Undo switch deletes the environment. Specify the ExcludeSettings switch to ignore the GPO templates specified in the XML. Specify the ExcludePermissions switch to ignore the permissions on scopes of management (SOMs) and on GPOs. Default permissions will be used instead. To use a migration table when you import GPOs, specify the MigrationTable switch and the path of the migration table file. Use the MigrationTable switch to map security principals and paths across domains. For more information about how to create a migration table, see the CreateMigrationTable.wsf script sample. Specify the Q switch to enable quiet mode, which suppresses all the confirmation warnings.
Usage: CreateEnvironmentFromXML.wsf /xml:<XmlFile> [/undo] [/Domain:<DNSDomainName>] [/dc:<DomainControllerName>] [/ExcludeSettings] [/ExcludePermissions] [/MigrationTable:<FilePath>]
Example: CreateEnvironmentFromXML.wsf /xml:TestDomain.xml /Domain:/example.microsoft.com /dc:testdomaindc-1 /MigrationTable:TestMigrationTable.xmlCreating an XML File that Represents a Policy Environment
The CreateXMLFromEnvironment.wsf sample reads an existing policy environment; for example, OUs, GPOs, and GPO links. The sample script creates an XML file that represents that environment. You can use this script in conjunction with the CreateEnvironmentFromXML.wsf script. If you do not specify a domain, the domain of the computer is the default.
Multiple switches are available for this script. Use the ExcludePermissions switch so that policy-related permissions are not recorded. Use the StartingOU switch to specify the Lightweight Directory Access Protocol (LDAP) path of an OU from which the XML should be built, rather than parsing the entire domain. Specify the IncludeUsers switch to include user accounts. Use the IncludeAllGroups switch to include groups from the Users container and from the domain root. If you do not specify the IncludeAllGroups switch, the script adds only the groups defined in the OUs to the XML file. If you specify a template path, the GPOs are exported to the specified location. Use the /TemplatePath switch to specify the location in which you want to store the backups of the GPO templates that contain the policy settings.
Usage: CreateXMLFromEnvironment.wsf <OutputFile> [/Domain:<DNSDomainName>] [/dc:<DomainControllerName>] [/TemplatePath:<Path>] [/StartingOU:<LDAPPath>] [/ExcludePermissions] [/IncludeAllGroups] [/IncludeUsers]Group Policy Management Console Xp
Example: CreateXMLFromEnvironment.wsf TestDomain.xml /Domain:example.microsoft.com
Example: CreateXMLFromEnvironment.wsf TestDomain.xml /StartingOU:OU=marketing,DC=MyDomain,DC=COM
Example: CreateXMLFromEnvironment.wsf TestDomain.xml /templatepath:backupsCreate Migration Table
The CreateMigrationTable.wsf sample creates a file that contains the XML representation of the paths and the security principals for the specified GPO source.
You can specify one of the following GPO sources:
*An individual GPO
*A backup location
*All the GPOs in a domain
Then, you can use the resulting XML when you perform GPO import and copy operations, which are typically performed across domains.
You can use the following switches:
*Use the GPO switch to use a single GPO source when you build the XML migration table.
*Use the BackupLocation switch to use GPO backups as a source when you build the XML migration table.
*Use the AllGPOs switch to use all the GPOs in the domain as a source to build the XML migration table.
*Use the Overwrite switch to overwrite an existing XML file instead of appending to it.
*Use the MapByName switch to specify a corresponding account with the same name as the original in the destination domain.
Usage: CreateMigrationTable.wsf <TableName> [/GPO:<GPO Name>] [/BackupLocation:<FilePath>] [/AllGPOs] [/Overwrite] [/MapByName] [/Domain:<DNSDomainName>]
Example: CreateMigrationTable.wsf SampleTable.xml /BackupLocation:c:GPOBackups /OverWrite /MapByName
Example: CreateMigrationTable.wsf SampleTable.xml /GPO:TestGPO
20192020 season. Example: CreateMigrationTable.wsf SampleTable.xml /AllGPOs /Overwrite /Domain:example.microsoft.comDeleting a GPO
The DeleteGPO.wsf sample deletes a GPO. You can specify the GPO by name or by its GPO ID. If you do not specify the KeepLinks parameter, all the links to the GPO in the specified domain and in any sites are deleted.
Usage: DeleteGPO.wsf <GPOName> [/KeepLinks] [/Domain:<DNSDomainName>]
Example: DeleteGPO.wsf MyGPOGrant Permissions for all GPOs in a Domain
The GrantPermissionOnAllGPOs.wsf sample takes a particular domain and then grants a user or a group the specified level of permission for all the GPOs in that domain. This sample grants the specified level of permission regardless of whether those GPOs are linked to an OU or not. Use the Permission switch to specify a permission level of Read, Apply, Edit, FullEdit, or None for the security principal specified in the GroupName parameter. Use the Replace switch to remove existing permissions for the group or user before you make the change. If a group or a user is already granted a permission level that is higher than the new permission level, and you do not specify the Replace switch, no change is made.
Consider the following example:
*The new permission level is Edit
*The user already has Full Edit permission
In this example, if you do not use the Replace switch, the user retains the Full Edit permission because the change is not applied
Usage: GrantPermissionOnAllGPOs.wsf <Group Name> /Permission: <Permission Level> [/Replace] [/Domain:<DNSDomainName>]
Example: GrantPermissionOnAllGPOs.wsf ’Marketing Group Administrators’/Permission:FullEdit /Replace
Example: GrantPermissionOnAllGPOs.wsf TestUser /Permission:ReadGroup Policy Management Console Scripting Samples Download FreeImporting a GPO
The ImportGPO.wsf sample imports the settings from a backup GPO to another GPO that you specify. Use the BackupLocation parameter to specify the location of the backup. Then, use the BackupID parameter to specify the GPO name or backup ID (GUID) of the backup to use. If you do not specify a GPO, the name of the GPO that was backed up will be used.
If you specify a GPO name or a GPO ID for the BackupID parameter, the script imports the most recent backup. To import an earlier version of a GPO backup, specify the unique backup ID for the backup. The unique backup ID is the string that uniquely identifies the backup within its backup directory. To retrieve the unique backup IDs for all the GPOs in a specific backup location, run the QueryBackupLocation.wsf script.
Specify the GPO to which you are importing the setting by using the TargetGPO parameter. Use the optional MigrationTable switch when you import a GPO to map security principals and paths across domains. If the specified GPO does not exist, use the CreateIfNeeded switch to create a new GPO.
Usage: ImportGPO.wsf <BackupLocation> <BackupID> [TargetGPO] [/MigrationTable:<FilePath>] [/CreateIfNeeded] [/Domain:<DNSDomainName>]
Example: ImportGPO.wsf f:backup TestGPO NewGPO /CreateIfNeeded
Example: ImportGPO.wsf f:backup {73624CC9-E8F2-4F05-88D2-193FAE8773CE} NewGPO /CreateIfNeededImporting Multiple GPOs into a Domain
The ImportAllGPOs.wsf sample creates new GPOs in a specified domain and imports settings into these new GPOs from a specified backup location. The script creates a new GPO and imports settings for the latest version of each backed-up GPO in the backup location. The names of the GPOs that were backed up are used for the new GPOs. The new GPOs are derived from a previous GPO backup. Therefore, if the previous GPOs still exist in the domain, they will be overwritten by the new GPOs. Any GPO settings that have been changed since the backup will be lost.
Usage: ImportAllGPOs.wsf <BackupLocation> [/MigrationTable:<FilePath>] [Domain:<DNSDomainName>]
Example: ImportAllGPOs.wsf f:backup /MigrationTable:f:Table1.xmlRestoring a GPO
The RestoreGPO.wsf sample restores a backup GPO to the original domain from which it was saved. If the original domain is unavailable, the RestoreGPO.wsf sample fails. Use the BackupLocation parameter to specify the location of the backup. Then, use the BackupID parameter to specify the GPO name or the backup ID (GUID) of the backup to use.
If you specify a GPO name or a GPO ID for the Backup parameter, the script restores the most recent backup. To restore an earlier version of a GPO backup, specify the unique backup ID for the backup. The unique backup ID is the string that uniquely identifies the backup in its backup directory. To retrieve the unique backup IDs for all the GPOs in a backup location, run the QueryBackupLocation.wsf script.
Usage: RestoreGPO.wsf <BackupLocation> <BackupID> [/Domain:<Domain>] [/DC:<DomainController>]
Examples: RestoreGPO.wsf f:backup BackUpGPO
RestoreGPO.wsf f:backup {73624CC9-E8F2-4F05-88D2-193FAE8773CE}Restoring all GPOs in a Domain
The RestoreAllGPOs.wsf sample restores the most recent backup of each GPO that is backed up to Active Directory in a specified backup location.
Usage: RestoreAllGPOs.wsf <BackupLocation> [/Domain:<DNSDomainName>]
Examples: RestoreAllGPOs.wsf f:backup /Domain:example.microsoft.comSetting GPO Permissions
The SetGPOPermissions.wsf sample takes a GPO name or GPO ID, group or user name, and permission level and grants that level of permission on the GPO. Use the Permission switch to specify a permission level of Read, Apply, Edit, FullEdit, or None for the security principal that is specified in the GroupName parameter. Use the Replace switch to remove the existing permissions for the group or user before you make the change. Otherwise, the script ensures that the group or user has at least the specified permission level.
Usage: SetGPOPermissions.wsf:<GPOName><GroupName> /Permission:<PermissionLevel> [/Replace] [/Domain:<DNSDomainName>]
Example: SetGPOPermissions.wsf TestGPO TestGroup /Permission:Edit
Example: SetGPOPermissions.wsf TestGPO TestGroup /Permission:Edit
Example: SetGPOPermission.wsf {73624CC9-E8F2-4F05-88D2-193FAE8773CE}TestUser /Permission:FullEdit /Replace /Domain:example.microsoft.comSetting Permissions for All GPOs Linked to a Scope of Management
The SetGPOPermissionsBySOM.wsf sample grants a user or group a specified permission level for all the GPOs that are linked to a specified SOM (a site, a domain, or an OU). Use the Permission switch to specify a permission level of Read, Apply, Edit, FullEdit, or None for the security principal that is specified in the GroupName parameter. Use the Replace switch to remove existing permissions for the group or user before you make the change. If a group or a user has a permission level that is higher than the new permission level, and you do not specify the Replace switch, no change is made.
Consider the following example:
*The new permission level is Edit
*The user already has Full Edit permission
In this example, if you do not use the Replace switch, the user retains the Full Edit permission because the change is not applied. Use the Recursive switch to apply the change to all the child OUs of the specified SOM.
Usage: SetGPOPermissionsBySOM.wsf <SOM Name> <Group Name> /Permission: <PermissionLevel> [/Recursive] [/Replace] [/Domain:<DNSDomainName>]
Example: SetGPOPermissionsBySOM.wsf ’Marketing Group Administrators’ ’Marketing Group’ /Permission:FullEdit /Recursive
Example: SetGPOPermissionsBySOM.wsf MarketingOU TestUser /Permission:Read /ReplaceSetting Permissions to Create GPOs
The SetGPOCreationPermissions.wsf sample grants or removes the permissions that let a user or security group create GPOs in a domain.
Usage: SetGPOCreationPermissions.wsf <GroupName> [Remove] [/Domain:<DNSDomainName>]
Example: SetGPOCreationPermissions.wsf ’Policy Administrators’Open Group Policy Management Console
Example: SetGPOCreationPermissions.wsf TestUser /removeSetting Policy-related Permissions on a SOM
The SetSOMPermissions.wsf sample grants a user or group the specified level of permission on a specified SOM (a site, a domain, or an OU). Use the Permission switch to specify a permission level of LinkGPOs, RSoPLogging, RSoPPlanning, All, or None for the SOM. You can specify either the display name or the full LDAP path of the SOM for the SOM Name parameter. The Inherit switch causes all child containers to inherit the setting. RSoP planning mode requires, at least, a Windows Server domain controller to perform the query, and is not applicable to sites.
Usage: SetSOMPermissions.wsf <SOM Name> <Group Name> /Permission:<PermissionLevel> [/Inherit] [/Domain:<DNSDomainName>]
Example: SetSOMPermissions.wsf ’Test Marketing OU’ ’Marketing Admin Group’ /Permission:All /Inherit
Example: SetSOMPermission.wsf MarketingOU TestUser /Permission:LinkGPOsListing All GPOs in a Domain
The ListAllGPOs.wsf sample prints a list of all the GPOs in the specified domain.
Note
Using the /v switch creates detailed or verbose output for each GPO.
Usage: ListAllGPOs.wsf [/v] [/Domain:<DNSDomainName>]
Example: ListAllGPOs.wsf /v /Domain:example.microsoft.comListing Disabled GPOs
The FindDisabledGPOs.wsf sample prints a list of all the GPOs that are disabled or partially disabled in the specified domain. This script enumerates both fully and partially disabled GPOs. The results are grouped accordingly.
Usage: FindDisabledGPOs.wsf [/Domain:<DNSDomainName>]
Example: FindDisabledGPOs.wsf /Domain:example.microsoft.comListing GPO Information
The DumpGPOInfo.wsf sample prints information for a specified GPO. You can specify the GPO by its name or its GPO ID.
Usage: DumpGPOInfo.wsf GPOName [/Domain:<DNSDomainName>]
Example: DumpGPOInfo.wsf MyGPO /Domain:example.microsoft.comListing GPOs at a Backup Location
The QueryBackupLocation.wsf sample prints a list of the GPOs that have been backed up to a specified file system location. For each backed-up GPO, the Verbose switch displays detailed information, such as the ID, the backup time, and any comments.
Usage: QueryBackupLocation.wsf <path> [/Verbose]
Example: QueryBackupLocation.wsf servershareGPOBackups /VerboseListing GPOs by Policy Extension
The FindGPOsByPolicyExtension.wsf sample prints a list of all the GPOs in
https://diarynote-jp.indered.space
コメント