< Back
Import-WmiFiltersFromJson
Post
NAME Import-WmiFiltersFromJson
SYNOPSIS
Imports WMI Filter information from a JSON file.
SYNTAX
Import-WmiFiltersFromJson [-Path] <String> [[-Domain] <String>] [-Force] [-Credential <PSCredential>] [-CimSession
<CimSession>] [<CommonParameters>]
DESCRIPTION
The cmdlet uses a backup of WMI filters written to a json file to restore each WMI filter in the provided domain.
PARAMETERS
-Path <String>
The location of the json file containing the WMI information. This file is created with the
Export-GPOBackupsAndWmiFilters cmdlet. It can also be created manually.
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-Domain <String>
The domain to import the WMI filters. This defaults to the domain of the current user.
Required? false
Position? 2
Default value [System.String]::Empty
Accept pipeline input? false
Accept wildcard characters? false
-Force [<SwitchParameter>]
Overwrites any existing WMI filters.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Credential <PSCredential>
Specifies a user account that has permission to perform this action. The default is the current user.
Type a user name, such as "User01" or "Domain01\\User01", or enter a PSCredential object, such as one generated
by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password.
Required? false
Position? named
Default value [System.Management.Automation.PSCredential]::Empty
Accept pipeline input? false
Accept wildcard characters? false
-CimSession <CimSession>
Specifies the CIM session to use for this cmdlet. Enter a variable that contains the CIM session or a command
that creates or gets the CIM session, such as the New-CimSession or Get-CimSession cmdlets. For more
information, see about_CimSessions.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
System.String
OUTPUTS
None
NOTES
AUTHOR: Michael Haken
LAST UPDATE: 1/4/2017
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Import-WmiFiltersFromJson -Path "c:\\GPOBackups\\WmiFilters.json" -Domain "contoso.com"
Imports the WMI filters stored at c:\\GPOBackups\\WmiFilters.json that were backed up to that path with
Export-GPOBackupsAndWmiFilters to contoso.com.
RELATED LINKS
SYNOPSIS
Imports WMI Filter information from a JSON file.
SYNTAX
Import-WmiFiltersFromJson [-Path] <String> [[-Domain] <String>] [-Force] [-Credential <PSCredential>] [-CimSession
<CimSession>] [<CommonParameters>]
DESCRIPTION
The cmdlet uses a backup of WMI filters written to a json file to restore each WMI filter in the provided domain.
PARAMETERS
-Path <String>
The location of the json file containing the WMI information. This file is created with the
Export-GPOBackupsAndWmiFilters cmdlet. It can also be created manually.
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-Domain <String>
The domain to import the WMI filters. This defaults to the domain of the current user.
Required? false
Position? 2
Default value [System.String]::Empty
Accept pipeline input? false
Accept wildcard characters? false
-Force [<SwitchParameter>]
Overwrites any existing WMI filters.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Credential <PSCredential>
Specifies a user account that has permission to perform this action. The default is the current user.
Type a user name, such as "User01" or "Domain01\\User01", or enter a PSCredential object, such as one generated
by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password.
Required? false
Position? named
Default value [System.Management.Automation.PSCredential]::Empty
Accept pipeline input? false
Accept wildcard characters? false
-CimSession <CimSession>
Specifies the CIM session to use for this cmdlet. Enter a variable that contains the CIM session or a command
that creates or gets the CIM session, such as the New-CimSession or Get-CimSession cmdlets. For more
information, see about_CimSessions.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
System.String
OUTPUTS
None
NOTES
AUTHOR: Michael Haken
LAST UPDATE: 1/4/2017
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Import-WmiFiltersFromJson -Path "c:\\GPOBackups\\WmiFilters.json" -Domain "contoso.com"
Imports the WMI filters stored at c:\\GPOBackups\\WmiFilters.json that were backed up to that path with
Export-GPOBackupsAndWmiFilters to contoso.com.
RELATED LINKS