- The MemPolicyManager module provides a comprehensive set of cmdlets for managing Microsoft Endpoint Manager policies. This module allows administrators to perform various tasks such as backing up, importing, exporting, and comparing policies through the Microsoft Graph API. It aims to streamline policy management and ensure that configurations are consistent and easily recoverable.
- The module is a personal project and is not officially supported by Microsoft. Use it at your own risk.
- The project was born out of a lack of native PowerShell cmdlets for easily managing Microsoft Endpoint Manager policies. The module aims to fill this gap, and assist me in developing my ability to work with MgGraph.
- The module was inspired and borrows concepts and code from: https://github.com/microsoft/mggraph-intune-samples/tree/main
The graphApiVersion parameter is experimental and may not work as expected. The default value is "beta". Do not change the value until further notice.
- Backup-EmMdmAppConfiguration
- Backup-EmMdmAppProtection
- Backup-EmMdmCompliance
- Backup-EmMdmConfiguration
- Backup-EmMdmEndpointSecurity
- Backup-EmMdmSettingsCatalog
- Backup-EmMdmSoftwareUpdate
- Compare-EmMgClass
- Convert-EmMgJsonToClass
- Convert-EmMgJsonToFlatObject
- Get-EmMdmAppConfiguration
- Get-EmMdmAppProtection
- Get-EmMdmCompliance
- Get-EmMdmConfiguration
- Get-EmMdmEndpointSecurity
- Get-EmMdmGraphAuth
- Get-EmMdmSoftwareUpdate
- Get-EmMgMetadataXml
- Get-EmMgMetadataXmlInfo
- Get-EmMgJsonResourceJson
- Get-EmMgResourceOperationJson
- Import-EmMdmAppConfiguration
- Import-EmMdmAppProtection
- Import-EmMdmCompliance
- Import-EmMdmConfiguration
- Import-EmMdmEndpointSecurity
- Import-EmMdmSettingsCatalog
- Import-EmMdmSoftwareUpdate
# Example 1: Backing up all App Configuration policies
Backup-EmMdmAppConfiguration -ExportPath "C:\Backup\AppConfigurations"
# Example 1: Importing App Protection Policy from JSON file
Import-EmMdmAppConfiguration -ImportPath "C:\Backup\AppConfigurationPolicy.json"
# Application Auth Examples
# Application Permissions required:
# DeviceManagementConfiguration.ReadWrite.All,
# DeviceManagementApps.ReadWrite.All,
# DeviceManagementManagedDevices.ReadWrite.All
## Client Secret Authentication ##
# Application (client) ID, Tenant ID, and Client Secret are required.
PS C:\> $ClientId = "12345678-1234-1234-1234-123456789012"
PS C:\> $TenantId = "12345678-1234-1234-1234-123456789012"
### Options for providing the Client Secret value
# To manually input the Client Secret value, use the following command:
PS C:\> $ClientSecretPSCredential = Get-Credential -Credential $ClientId
# To provide the secret value in plain text, use the following command:
PS C:\> $ClientSecret = ConvertTo-SecureString "<ClientSecretValue>" -AsPlainText
# To retrieve the secret value from a local Vault, use the following command:
PS C:\> $ClientSecret = Get-Secret -Name "MgGraphSecret" -VaultName "EmMdmVault"
# To Create a PSAutomationCredential object with the Client/App Id and Client Secret (as a secure string).
PS C:\> $ClientSecretPSCredential = [PsCredential]::New($ClientId,$ClientSecret)
# Create the authentication object with the Client Secret values.
PS C:\> $authObject = Get-EmMdmGraphAuth -ClientSecretTenantId $TenantId -ClientSecretValue $ClientSecretPSCredential
# Example Usage: Retrieve the policies using the authentication object.
PS C:\> $policies = Get-EmMdmAppConfiguration -AuthObject $authObject
### Options for providing the Client Secret value
## Client Secret Authentication ##
# Certificate Authentication Options
## Self-Signed Certificate Authentication ##
# Create a self-signed certificate and export it to a file.
PS C:\> $CertName = "EmMdmMgGraphCert" # Replace CN=EmMdmMgGraphCert
PS C:\> $cert = New-SelfSignedCertificate -Subject "CN=$CertName" -CertStoreLocation "Cert:\CurrentUser\My" `
-KeyExportPolicy Exportable -KeySpec Signature -KeyLength 2048 -KeyAlgorithm RSA -HashAlgorithm SHA256
# Export the certificate to a file and upload the public key to the MgGraph application.
PS C:\> Export-Certificate -Cert $cert -FilePath "C:\temp\$CertName.cer" ## Specify your preferred location
## Self-Signed Certificate Authentication ##
## Certificate Thumbprint Authentication ##
# Retrieve the certificate thumbprint from the local certificate store using the previous steps.
PS C:\> $ThumbPrint = $cert.Thumbprint
# Retrieve the certificate thumbprint from a local Vault if saved previously.
PS C:\> $ClientCertThumbPrint = Get-Secret -Name "EmMdmMgGraphThumbprint" -Vault "EmMdmVault" -AsPlainText
# Create the authentication object with the certificate thumbprint.
PS C:\> $authObject = Get-EmMdmGraphAuth -CertificateThumbprintClientId $ClientId -CertificateThumbprintTenantId $TenantId -CertificateThumbprint $ClientCertThumbPrint
# Example Usage: Retrieve the policies using the authentication object.
PS C:\> $policies = Get-EmMdmAppConfiguration -AuthObject $authObject
## Certificate Thumbprint Authentication ##
## Certificate Name Authentication ##
PS C:\> $CertName = "CN=EmMdmMgGraphCert" ## Replace CN=EmMdmMgGraphCert
PS C:\> $authObject = Get-EmMdmGraphAuth -CertificateNameClientId $ClientId -CertificateNameTenantId $TenantId -CertificateName $CertName
PS C:\> $policies = Get-EmMdmAppConfiguration -AuthObject $authObject
## Certificate Name Authentication ##
## X509 Certificate Authentication ##
PS C:\> $ThumbPrint = Get-Secret -Name "EmMdmMgGraphThumbprint" -Vault "EmMdmVault" -AsPlainText
PS C:\> $Cert = Get-ChildItem Cert:\CurrentUser\My\$ThumbPrint
PS C:\> $authObject = Get-EmMdmGraphAuth -X509CertificateClientId $ClientId -X509CertificateTenantId $TenantId -X509Certificate $Cert
PS C:\> $policies = Get-EmMdmAppConfiguration -AuthObject $authObject
## X509 Certificate Authentication ##
## Certificate Authentication Options
## Access Token Authentication ##
# Instantiate the Client ID, Tenant ID, and Client Secret values.
$ClientId = "12345678-1234-1234-1234-123456789012"
$TenantId = "12345678-1234-1234-1234-123456789012"
$ClientSecret = Get-Secret -Name "MgGraphClientSecret" -Vault "EmMdmVault" -AsPlainText
$ContentType = "application/x-www-form-urlencoded"
$scope = "https://graph.microsoft.com/.default"
# Construct the URI
$uri = "https://login.microsoftonline.com/$TenantId/oauth2/v2.0/token"
# Construct the body of the request
$body = @{
client_id = $ClientId
scope = $scope
client_secret = $ClientSecret
grant_type = "client_credentials"
}
# Make the POST request to get the token
$response = Invoke-RestMethod -Uri $uri -Method Post -ContentType $ContentType -Body $body
$AccessToken = $response.access_token | ConvertTo-SecureString -AsPlainText -Force
# Create the authentication object with the access token.
$authObject = Get-EmMdmGraphAuth -AccessToken $AccessToken
# Example Usage: Retrieve the policies using the authentication object.
$policies = Get-EmMdmAppConfiguration -AuthObject $authObject
## Access Token Authentication ##
## System Assigned Managed Identity Authentication (Azure Resource)##
# Create the authentication object
$authObject = Get-EmMdmGraphAuth -SystemAssignedIdentity
# Example Usage: Retrieve the policies using the authentication object.
$policies = Get-EmMdmAppConfiguration -AuthObject $authObject
## System Assigned Managed Identity Authentication (Azure Resource)##
## User Assigned Managed Identity Authentication (Azure Resource)##
# Create the authentication object
$authObject = Get-EmMdmGraphAuth -UserAuthManagedIdentity "12345678-1234-1234-1234-123456789012"
# Example Usage: Retrieve the policies using the authentication object.
$policies = Get-EmMdmAppConfiguration -AuthObject $authObject
## User Assigned Managed Identity Authentication (Azure Resource)##
## Connect using Environment Variables ##
# Set the environment variables
$authObject = Get-EmMdmGraphAuth -EnvironmentVariable
# Example Usage: Retrieve the policies using the authentication object.
$policies = Get-EmMdmAppConfiguration -AuthObject $authObject
## Connect using Environment Variables ##
Backs up Intune App Configuration policies to a specified export path.
Backup-EmMdmAppConfiguration [-ExportPath] <String> [[-AuthObject] <EmMdmAuthBase>] [[-graphApiVersion] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
ExportPath | The directory path where the App Configuration policies will be exported. This parameter is mandatory. | true | true (ByValue, ByPropertyName\) | ||
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- [string] The cmdlet accepts a directory path as input.
- [void] This cmdlet does not output any objects.
The cmdlet uses the following functions: - New-EmMdmBackupDirectory - Connect-EmMdmGraph - Get-EmMdmAppConfigurationAPI - Backup-EmMdmPolicy - Disconnect-MgGraph
EXAMPLE 1
Backup-EmMdmAppConfiguration -ExportPath "C:\Backup\AppConfigurations"
This example connects to Microsoft Graph, retrieves Intune App Configuration policies, and exports them to the specified directory "C:\Backup\AppConfigurations" as JSON files.
EXAMPLE 2
$authObject = Get-EmMdmGraphAuth -ClientSecretId "your-client-id" -ClientSecretTenantId "your-tenant-id" -ClientSecretValue "your-client-secret"
PS> Backup-EmMdmAppConfiguration -ExportPath "C:\Backup\AppConfigurations" -AuthObject $authObject
This example creates an authentication object using Client Secret authentication and uses it to connect to Microsoft Graph, retrieve Intune App Configuration policies, and export them to the specified directory.
Backs up Intune App Protection policies to a specified export path.
Backup-EmMdmAppProtection [-ExportPath] <String> [[-AuthObject] <EmMdmAuthBase>] [[-graphApiVersion] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
ExportPath | The directory path where the App Protection policies will be exported. This parameter is mandatory. | true | true (ByValue, ByPropertyName\) | ||
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- [string] The cmdlet accepts a directory path as input.
- [void] This cmdlet does not output any objects.
The cmdlet uses the following functions: - New-EmMdmBackupDirectory - Connect-EmMdmGraph - Get-EmMdmAppProtectionAPI - Backup-EmMdmPolicy - Disconnect-MgGraph
EXAMPLE 1
Backup-EmMdmAppProtection -ExportPath "C:\Backup\AppProtections"
This example connects to Microsoft Graph, retrieves Intune App Protection policies, and exports them to the specified directory "C:\Backup\AppProtections" as JSON files.
Backs up Intune Device Compliance policies to a specified export path.
Backup-EmMdmCompliance [-ExportPath] <String> [[-OperatingSystem] <String>] [[-AuthObject] <EmMdmAuthBase>] [[-graphApiVersion] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
ExportPath | The directory path where the Device Compliance policies will be exported. This parameter is mandatory. | true | true (ByValue, ByPropertyName\) | ||
OperatingSystem | The operating system filter for the compliance policies. Valid values are "android", "iOS", "Win10", "macos", and "all". The default value is "all". | false | false | all | |
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- [string] The cmdlet accepts a directory path as input.
- [string] This cmdlet returns the export path upon successful completion.
The cmdlet uses the following functions: - New-EmMdmBackupDirectory - Connect-EmMdmGraph - Get-EmMdmComplianceAPI - Backup-EmMdmPolicy - Disconnect-MgGraph
EXAMPLE 1
Backup-EmMdmCompliance -ExportPath "C:\Backup\CompliancePolicies" -OperatingSystem "Win10"
This example connects to Microsoft Graph, retrieves Windows 10 Device Compliance policies, and exports them to the specified directory "C:\Backup\CompliancePolicies" as JSON files.
EXAMPLE 2
Backup-EmMdmCompliance -ExportPath "C:\Backup\CompliancePolicies" -graphApiVersion "v1.0"
This example connects to Microsoft Graph using the 'v1.0' API version, retrieves all Device Compliance policies, and exports them to the specified directory "C:\Backup\CompliancePolicies" as JSON files.
Backs up Intune Device Configuration policies to a specified export path.
Backup-EmMdmConfiguration [[-DeviceType] <String>] [-ExportPath] <String> [[-AuthObject] <EmMdmAuthBase>] [[-graphApiVersion] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
DeviceType | The device type filter for the configuration policies. Valid values are "windows81", "macOSExtensions", "macOSCustom", "macOSDeviceFeatures", "macOSGeneral", "macOSSoftwareUpdate", "macOSEndpointProtection", "androidWorkProfileGeneral", "androidWorkProfileVpn", "windowsHealthMonitoring", "windows81SCEP", "windows10Custom", "windows10EndpointProtection", "windows10General", and "all". The default value is "all". | false | false | all | |
ExportPath | The directory path where the Device Configuration policies will be exported. This parameter is mandatory. | true | true (ByValue, ByPropertyName\) | ||
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- [string] The cmdlet accepts a directory path as input.
- [void] This cmdlet does not output any objects.
The cmdlet uses the following functions: - New-EmMdmBackupDirectory - Connect-EmMdmGraph - Get-EMMdmConfigurationAPI - Backup-EmMdmPolicy - Disconnect-MgGraph
EXAMPLE 1
Backup-EmMdmConfiguration -DeviceType "windows10General" -ExportPath "C:\Backup\DeviceConfigurations"
This example connects to Microsoft Graph, retrieves Windows 10 General Device Configuration policies, and exports them to the specified directory "C:\Backup\DeviceConfigurations" as JSON files.
EXAMPLE 2
Backup-EmMdmConfiguration -DeviceType "all" -ExportPath "C:\Backup\DeviceConfigurations" -graphApiVersion "v1.0"
This example connects to Microsoft Graph using the 'v1.0' API version, retrieves all Device Configuration policies, and exports them to the specified directory "C:\Backup\DeviceConfigurations" as JSON files.
Backs up Intune Endpoint Security policies to a specified export path.
Backup-EmMdmEndpointSecurity [-ExportPath] <String> [[-AuthObject] <EmMdmAuthBase>] [[-graphApiVersion] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
ExportPath | The directory path where the Endpoint Security policies will be exported. This parameter is mandatory. | true | true (ByValue, ByPropertyName\) | ||
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- [string] The cmdlet accepts a directory path as input.
- [void] This cmdlet does not output any objects.
The cmdlet uses the following functions: - New-EmMdmBackupDirectory - Connect-EmMdmGraph - Get-EmEndpointSecurityTemplate - Get-EmDMIntent - Get-EmDMTemplateSettingCategory - Get-EmDMSettingInstance - Backup-EmMdmPolicy - Disconnect-MgGraph
EXAMPLE 1
Backup-EmMdmEndpointSecurity -ExportPath "C:\Backup\EndpointSecurity"
This example connects to Microsoft Graph, retrieves Intune Endpoint Security policies, and exports them to the specified directory "C:\Backup\EndpointSecurity" as JSON files.
EXAMPLE 2
Backup-EmMdmEndpointSecurity -ExportPath "C:\Backup\EndpointSecurity" -graphApiVersion "v1.0"
This example connects to Microsoft Graph using the 'v1.0' API version, retrieves Intune Endpoint Security policies, and exports them to the specified directory "C:\Backup\EndpointSecurity" as JSON files.
Backs up Intune Settings Catalog policies to a specified export path.
Backup-EmMdmSettingsCatalog [-ExportPath] <String> [[-Platform] <String>] [[-AuthObject] <EmMdmAuthBase>] [[-graphApiVersion] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
ExportPath | The directory path where the Settings Catalog policies will be exported. This parameter is mandatory. | true | true (ByValue, ByPropertyName\) | ||
Platform | The platform for which to retrieve policies. Valid values are "windows10" and "macOS". The default value is null, which retrieves policies for all platforms. | false | false | ||
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- [string] The cmdlet accepts a directory path as input.
- [void] This cmdlet does not output any objects.
The cmdlet uses the following functions: - New-EmMdmBackupDirectory - Connect-EmMdmGraph - Get-EmMdmSettingsCatalogAPI - Get-EmMdmSettingsCatalogSettingsAPI - Backup-EmMdmPolicy - Disconnect-MgGraph
EXAMPLE 1
Backup-EmMdmSettingsCatalog -ExportPath "C:\Backup\SettingsCatalog"
This example connects to Microsoft Graph, retrieves Intune Settings Catalog policies, and exports them to the specified directory "C:\Backup\SettingsCatalog" as JSON files.
EXAMPLE 2
Backup-EmMdmSettingsCatalog -ExportPath "C:\Backup\SettingsCatalog" -Platform "windows10"
This example connects to Microsoft Graph, retrieves Intune Settings Catalog policies for Windows 10, and exports them to the specified directory "C:\Backup\SettingsCatalog" as JSON files.
Backs up Intune Software Update policies to a specified export path.
Backup-EmMdmSoftwareUpdate [-ExportPath] <String> [[-AuthObject] <EmMdmAuthBase>] [[-graphApiVersion] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
ExportPath | The directory path where the Software Update policies will be exported. This parameter is mandatory. | true | true (ByValue, ByPropertyName\) | ||
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- [string] The cmdlet accepts a directory path as input.
- [void] This cmdlet does not output any objects.
The cmdlet uses the following functions: - New-EmMdmBackupDirectory - Connect-EmMdmGraph - Get-EmMdmConfigurationAPI - Backup-EmMdmPolicy - Disconnect-MgGraph
EXAMPLE 1
Backup-EmMdmSoftwareUpdate -ExportPath "C:\Backup\SoftwareUpdates"
This example connects to Microsoft Graph, retrieves Intune Software Update policies, and exports them to the specified directory "C:\Backup\SoftwareUpdates" as JSON files.
Compares two PowerShell classes and outputs their differences.
Compare-EmMgClass [-Class1] <Type> [-Class2] <Type> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Class1 | The first class to compare. This parameter is mandatory. | true | false | ||
Class2 | The second class to compare. This parameter is mandatory. | true | false |
- [Type] The cmdlet accepts two class types as input.
- [string] The cmdlet outputs a string indicating whether the classes are different or identical. It also outputs the specific property and method differences, if any.
The cmdlet uses the Compare-Object cmdlet to compare properties and methods of the specified classes.
EXAMPLE 1
Compare-EmMgClass -Class1 [ClassA] -Class2 [ClassB]
This example compares ClassA and ClassB, outputting their differences in properties and methods.
Converts a JSON string to a PowerShell class definition.
Convert-EmMgJsonToClass [-Json] <String> [-ClassName] <String> [-Operation] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Json | The JSON string to be converted into a PowerShell class. This parameter is mandatory. | true | false | ||
ClassName | The name of the class to be generated. This parameter is mandatory. | true | false | ||
Operation | The operation type to customize the generated class. Valid values are "create", "update", and "get". This parameter is mandatory. | true | false |
- [string] The cmdlet accepts a JSON string and a class name as input.
- [string] The cmdlet outputs the generated PowerShell class definition as a string.
The cmdlet generates a PowerShell class with properties, a default constructor, and a parameterized constructor based on the JSON string. The cmdlet uses different operations to customize the class properties and constructors.
EXAMPLE 1
$json = '{"name": "Test", "value": 123}'
PS> Convert-EmMgJsonToClass -Json $json -ClassName "TestClass" -Operation "create"
This example converts the JSON string into a PowerShell class named "TestClass" for the "create" operation.
Converts a JSON string or file to a flat PowerShell object.
Convert-EmMgJsonToFlatObject -ImportPath <String> [<CommonParameters>]
Convert-EmMgJsonToFlatObject -JSON <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
ImportPath | The path to the JSON file to be imported. This parameter is mandatory when using the 'Import' parameter set. | true | true (ByPropertyName\) | ||
JSON | The JSON string to be converted to a flat object. This parameter is mandatory when using the 'StringObject' parameter set. | true | true (ByValue, ByPropertyName\) |
- [string] The cmdlet accepts a JSON string or a file path as input.
- [PSCustomObject] The cmdlet outputs a flat PowerShell object.
The cmdlet uses the ConvertTo-FlatObject function to flatten the JSON structure. The cmdlet supports two parameter sets: 'Import' for importing JSON from a file and 'StringObject' for converting JSON strings. Borrowed private function code from: https://powersnippets.com/convertto-flatobject/
EXAMPLE 1
Convert-EmMgJsonToFlatObject -ImportPath "C:\path\to\file.json"
This example imports the JSON file from the specified path and converts it to a flat PowerShell object.
EXAMPLE 2
'{"name": "Test", "value": {"nested": 123}}' | Convert-EmMgJsonToFlatObject
This example takes a JSON string from the pipeline, converts it to a flat PowerShell object, and outputs the result.
Retrieves Intune App Configuration policies from Microsoft Graph.
Get-EmMdmAppConfiguration [[-AuthObject] <EmMdmAuthBase>] [[-graphApiVersion] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- None. This cmdlet does not accept pipeline input.
- [GetEmMdmTargetedManagedAppConfiguration[]] The cmdlet returns an array of Intune App Configuration policy objects.
The cmdlet uses the following functions: - Connect-EmMdmGraph - Get-EmMdmAppConfigurationAPI - Disconnect-MgGraph
EXAMPLE 1
Get-EmMdmAppConfiguration
This example connects to Microsoft Graph using the 'beta' API version and retrieves Intune App Configuration policies.
EXAMPLE 2
Get-EmMdmAppConfiguration -graphApiVersion "v1.0"
This example connects to Microsoft Graph using the 'v1.0' API version and retrieves Intune App Configuration policies.
Retrieves Intune App Protection policies from Microsoft Graph.
Get-EmMdmAppProtection [[-AuthObject] <EmMdmAuthBase>] [[-graphApiVersion] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- None. This cmdlet does not accept pipeline input.
- [pscustomobject[]] The cmdlet returns an array of Intune App Protection policy objects.
The cmdlet uses the following functions: - Connect-EmMdmGraph - Get-EmMdmAppProtectionAPI - Disconnect-MgGraph
EXAMPLE 1
Get-EmMdmAppProtection
This example connects to Microsoft Graph using the 'beta' API version and retrieves Intune App Protection policies.
EXAMPLE 2
Get-EmMdmAppProtection -graphApiVersion "v1.0"
This example connects to Microsoft Graph using the 'v1.0' API version and retrieves Intune App Protection policies.
Retrieves Intune Device Compliance policies from Microsoft Graph.
Get-EmMdmCompliance [[-OperatingSystem] <String>] [[-AuthObject] <EmMdmAuthBase>] [[-graphApiVersion] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
OperatingSystem | The operating system for which to retrieve compliance policies. Valid values are "android", "iOS", "Win10", "macos", and "all". The default value is "all". | false | false | all | |
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- None. This cmdlet does not accept pipeline input.
- The cmdlet returns an array of Intune Device Compliance policy objects.
The cmdlet uses the following functions: - Connect-EmMdmGraph - Get-EmMdmComplianceAPI - Disconnect-MgGraph
EXAMPLE 1
Get-EmMdmCompliance -OperatingSystem "android"
This example connects to Microsoft Graph using the 'beta' API version and retrieves Intune Device Compliance policies for Android devices.
EXAMPLE 2
Get-EmMdmCompliance -OperatingSystem "iOS" -graphApiVersion "v1.0"
This example connects to Microsoft Graph using the 'v1.0' API version and retrieves Intune Device Compliance policies for iOS devices.
EXAMPLE 3
Get-EmMdmCompliance
This example connects to Microsoft Graph using the 'beta' API version and retrieves Intune Device Compliance policies for all supported operating systems.
Retrieves Intune Device Configuration policies from Microsoft Graph.
Get-EmMdmConfiguration [[-DeviceType] <String>] [-AuthObject <EmMdmAuthBase>] [-graphApiVersion <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
DeviceType | The device type for which to retrieve configuration policies. Valid values are "windows81", "macOSExtensions", "macOSCustom", "macOSDeviceFeatures", "macOSGeneral", "macOSSoftwareUpdate", "macOSEndpointProtection", "androidWorkProfileGeneral", "androidWorkProfileVpn", "windowsHealthMonitoring", "windows81SCEP", "windows10Custom", "windows10EndpointProtection", "windows10General", and "all". The default value is "all". | false | false | all | |
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- None. This cmdlet does not accept pipeline input.
- The cmdlet returns an array of Intune Device Configuration policy objects.
The cmdlet uses the following functions: - Connect-EmMdmGraph - Get-EmMdmConfigurationAPI - Disconnect-MgGraph
EXAMPLE 1
Get-EmMdmConfiguration -DeviceType "windows81"
This example connects to Microsoft Graph using the 'beta' API version and retrieves Intune Device Configuration policies for Windows 8.1 devices.
EXAMPLE 2
Get-EmMdmConfiguration -DeviceType "macOSGeneral" -graphApiVersion "v1.0"
This example connects to Microsoft Graph using the 'v1.0' API version and retrieves Intune Device Configuration policies for macOS devices.
EXAMPLE 3
Get-EmMdmConfiguration
This example connects to Microsoft Graph using the 'beta' API version and retrieves Intune Device Configuration policies for all supported device types.
Retrieves Intune Endpoint Security policies from Microsoft Graph.
Get-EmMdmEndpointSecurity [[-AuthObject] <EmMdmAuthBase>] [[-graphApiVersion] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- None. This cmdlet does not accept pipeline input.
- EmDManagementIntentInstanceCustom[] The cmdlet returns an array of EmDManagementIntentInstanceCustom objects representing the Endpoint Security policies.
The cmdlet uses the following functions: - Connect-EmMdmGraph - Get-EmEndpointSecurityTemplate - Get-EmDMIntent - Get-EmDMTemplateSettingCategory - Get-EmDMSettingInstance - Disconnect-MgGraph
EXAMPLE 1
Get-EmMdmEndpointSecurity -graphApiVersion $graphApiVersion
This example connects to Microsoft Graph using the 'beta' API version and retrieves Intune Endpoint Security policies.
EXAMPLE 2
Get-EmMdmEndpointSecurity -graphApiVersion "v1.0"
This example connects to Microsoft Graph using the 'v1.0' API version and retrieves Intune Endpoint Security policies.
Creates an authentication object for connecting to Microsoft Graph using various authentication methods.
Get-EmMdmGraphAuth [-ClientSecretTenantId] <String> [-ClientSecretValue] <PSCredential> [<CommonParameters>]
Get-EmMdmGraphAuth [-CertificateThumbprintClientId] <String> [-CertificateThumbprintTenantId] <String> [-CertificateThumbprint] <String> [<CommonParameters>]
Get-EmMdmGraphAuth [-CertificateNameClientId] <String> [-CertificateNameTenantId] <String> [-CertificateName] <String> [<CommonParameters>]
Get-EmMdmGraphAuth [-UserAuthManagedIdentity] <String> [<CommonParameters>]
Get-EmMdmGraphAuth [-SystemAssignedIdentity] [<CommonParameters>]
Get-EmMdmGraphAuth [-AccessToken] <SecureString> [<CommonParameters>]
Get-EmMdmGraphAuth [-EnvironmentVariable] [<CommonParameters>]
Get-EmMdmGraphAuth [-X509CertificateClientId] <String> [-X509Certificate] <X509Certificate> [-X509CertificateTenantId] <String> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
ClientSecretTenantId | The Tenant ID for the application using Client Secret authentication. Mandatory for ClientSecret parameter set. | true | false | ||
ClientSecretValue | The Client Secret value for the application using Client Secret authentication. Mandatory for ClientSecret parameter set. Must be a PSCredential object. | true | false | ||
CertificateThumbprintClientId | The Client ID for the application using Certificate Thumbprint authentication. Mandatory for CertificateThumbprint parameter set. | true | false | ||
CertificateThumbprintTenantId | The Tenant ID for the application using Certificate Thumbprint authentication. Mandatory for CertificateThumbprint parameter set. | true | false | ||
CertificateThumbprint | The Certificate Thumbprint for the application using Certificate Thumbprint authentication. Mandatory for CertificateThumbprint parameter set. | true | false | ||
CertificateNameClientId | The Client ID for the application using Certificate Name authentication. Mandatory for CertificateName parameter set. | true | false | ||
CertificateNameTenantId | The Tenant ID for the application using Certificate Name authentication. Mandatory for CertificateName parameter set. | true | false | ||
CertificateName | The Certificate Name for the application using Certificate Name authentication. Mandatory for CertificateName parameter set. | true | false | ||
UserAuthManagedIdentity | The Client ID for the Managed Identity. Mandatory for UserAuthManagedIdentity parameter set. | true | false | ||
SystemAssignedIdentity | Indicates the use of a System Assigned Identity for authentication. Mandatory for SystemAssignedIdentity parameter set. | true | false | False | |
AccessToken | Specifies a bearer token for Microsoft Graph service. Mandatory for AccessToken parameter set. | true | false | ||
EnvironmentVariable | Allows for authentication using environment variables configured on the host machine. Mandatory for EnvironmentVariable parameter set. | true | false | False | |
X509CertificateClientId | The client id of your application for X509 certificate authentication. Mandatory for X509Certificate parameter set. | true | false | ||
X509Certificate | true | false | |||
X509CertificateTenantId | The id of the tenant to connect to for X509 certificate authentication. Mandatory for X509Certificate parameter set. | true | false |
- None
- PSCustomObject Returns an authentication object for connecting to Microsoft Graph.
https://criticalsolutionsnetwork.github.io/MemPolicyManager/\#Get-EmMdmGraphAuth
EXAMPLE 1
$authObject = Get-EmMdmGraphAuth -ClientSecretTenantId $TenantId -ClientSecretValue $ClientSecretPSCredential
Creates an authentication object using Client Secret authentication.
The Client Secret value is provided as a PSCredential object.
# $ClientId = "<your-client-id>"
# ClientSecret = ConvertTo-SecureString -String "<your-client-secret>" -AsPlainText -Force
# Ex: $ClientSecretPSCredential = [PsCredential]::New($ClientId,$ClientSecret)
EXAMPLE 2
$authObject = Get-EmMdmGraphAuth -CertificateThumbprintClientId $ClientId -CertificateThumbprintTenantId $TenantId -CertificateThumbprint $ClientCertThumbPrint
Creates an authentication object using Certificate Thumbprint authentication.
EXAMPLE 3
$authObject = Get-EmMdmGraphAuth -CertificateNameClientId $ClientId -CertificateNameTenantId $TenantId -CertificateName $CertName
Creates an authentication object using Certificate Name authentication.
EXAMPLE 4
$authObject = Get-EmMdmGraphAuth -UserAuthManagedIdentity $ClientId
Creates an authentication object using Managed Identity authentication.
EXAMPLE 5
$authObject = Get-EmMdmGraphAuth -SystemAssignedIdentity
Creates an authentication object using System Assigned Identity authentication.
EXAMPLE 6
$authObject = Get-EmMdmGraphAuth -AccessToken (ConvertTo-SecureString -String "your-access-token" -AsPlainText -Force)
Creates an authentication object using Access Token authentication.
EXAMPLE 7
$authObject = Get-EmMdmGraphAuth -EnvironmentVariable
Creates an authentication object using Environment Variable authentication.
EXAMPLE 8
$authObject = Get-EmMdmGraphAuth -X509CertificateClientId $ClientId -X509CertificateTenantId $TenantId -X509Certificate $Cert
Creates an authentication object using X509 Certificate authentication.
Retrieves Intune Device Update policies from Microsoft Graph.
Get-EmMdmSoftwareUpdate [[-AuthObject] <EmMdmAuthBase>] [[-graphApiVersion] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- None. This cmdlet does not accept pipeline input.
- [pscustomobject[]] The cmdlet returns an array of PSCustomObject representing the Device Update policies.
The cmdlet uses the following functions: - Connect-EmMdmGraph - Get-EmMdmConfigurationAPI - Disconnect-MgGraph
EXAMPLE 1
Get-EmMdmSoftwareUpdate -graphApiVersion $graphApiVersion
This example connects to Microsoft Graph using the 'beta' API version and retrieves Intune Device Update policies.
EXAMPLE 2
Get-EmMdmSoftwareUpdate -graphApiVersion "v1.0"
This example connects to Microsoft Graph using the 'v1.0' API version and retrieves Intune Device Update policies.
Downloads the Microsoft Graph metadata XML file.
Get-EmMgMetadataXml [-OutputPath] <String> [-graphApiVersion <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
OutputPath | The file path where the metadata XML file will be saved. This parameter is mandatory. | true | true (ByPropertyName\) | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta |
- None. This cmdlet does not accept pipeline input.
- [string] The cmdlet outputs a message indicating the success or failure of the metadata XML download.
The cmdlet uses the following functions: - Invoke-WebRequest
EXAMPLE 1
Get-EmMgMetadataXml -OutputPath "C:\GraphMetadata\metadata.xml"
This example connects to Microsoft Graph using the 'beta' API version and downloads the metadata XML file to "C:\GraphMetadata\metadata.xml".
EXAMPLE 2
Get-EmMgMetadataXml -OutputPath "C:\GraphMetadata\metadata.xml" -graphApiVersion "v1.0"
This example connects to Microsoft Graph using the 'v1.0' API version and downloads the metadata XML file to "C:\GraphMetadata\metadata.xml".
Retrieves metadata information for a specific entity type from a Microsoft Graph metadata XML file.
Get-EmMgMetadataXmlInfo [-XmlFilePath] <String> [-TypeName] <String> [[-InfoType] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
XmlFilePath | The file path to the Microsoft Graph metadata XML file. This parameter is mandatory. | true | false | ||
TypeName | The name of the entity type to retrieve information for. This parameter is mandatory. | true | false | ||
InfoType | The type of information to retrieve. Default is "EntityType". | false | false | EntityType |
- None. This cmdlet does not accept pipeline input.
- [PSCustomObject] The cmdlet outputs a custom object containing detailed information about the specified entity type, including its properties, methods, actions, enums, relationships, and a JSON representation.
The cmdlet uses XPath queries to navigate the metadata XML and extract relevant information.
EXAMPLE 1
Get-EmMgMetadataXmlInfo -XmlFilePath "C:\GraphMetadata\metadata.xml" -TypeName "User"
This example retrieves metadata information for the 'User' entity type from the specified Microsoft Graph metadata XML file.
EXAMPLE 2
Get-EmMgMetadataXmlInfo -XmlFilePath "C:\GraphMetadata\metadata.xml" -TypeName "Device"
This example retrieves metadata information for the 'Device' entity type from the specified Microsoft Graph metadata XML file.
Retrieves JSON resource and property information from Microsoft Graph API documentation.
Get-EmMgResourceJson [-ODataTypes] <String[]> [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
ODataTypes | An array of OData types for which to retrieve JSON resource data. This parameter is mandatory. | true | false |
- [string[]] The cmdlet accepts an array of OData types as input.
- [PSCustomObject] The cmdlet outputs a custom object containing the JSON representation and properties table of the specified OData types.
The cmdlet constructs the URL to the Microsoft Graph API documentation for each specified OData type, downloads the markdown content, and parses the JSON resource data and properties table.
EXAMPLE 1
Get-EmMgResourceJson -ODataTypes "macOSExtensionsConfiguration", "windows81TrustedRootCertificate"
This example retrieves JSON resource data and properties table for the specified OData types from Microsoft Graph API documentation.
Retrieves JSON examples for specified OData types and operations from Microsoft Graph API documentation.
Get-EmMgResourceOperationJson [-ODataTypes] <String[]> [-Operation] <String> [-Resource] <String> [[-graphApiVersion] <String>] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
ODataTypes | An array of OData types for which to retrieve JSON examples. This parameter is mandatory. | true | false | ||
Operation | The operation type for which to retrieve JSON examples. Valid values are "get", "create", and "update". This parameter is mandatory. | true | false | ||
Resource | The resource type for which to retrieve JSON examples. Valid values are "intune-deviceconfig" and "intune-mam". This parameter is mandatory. | true | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta |
- [string[]] The cmdlet accepts an array of OData types as input.
- [PSCustomObject] The cmdlet outputs a custom object containing JSON examples for the specified OData types and operations.
The cmdlet constructs the URL to the Microsoft Graph API documentation for each specified OData type and operation, downloads the markdown content, and parses the JSON examples.
EXAMPLE 1
Get-EmMgResourceOperationJson -ODataTypes "androidCompliancePolicy", "iosCompliancePolicy" -Operation "get" -Resource "intune-deviceconfig"
This example retrieves JSON examples for the specified OData types and get operations from Microsoft Graph API documentation.
Imports Intune App Configuration policies from a specified JSON file.
Import-EmMdmAppConfiguration [-ImportPath] <String> [[-AuthObject] <EmMdmAuthBase>] [[-graphApiVersion] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
ImportPath | The file path to the JSON file containing the App Configuration policy to import. This parameter is mandatory. | true | true (ByValue, ByPropertyName\) | ||
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- [string] The cmdlet accepts a file path as input.
- [string] The cmdlet outputs the ID of the created policy.
The cmdlet uses the following functions: - Connect-EmMdmGraph - Add-EmMdmAppConfiguration - Disconnect-MgGraph
EXAMPLE 1
Import-EmMdmAppConfiguration -ImportPath "C:\Backup\AppConfigurations\Policy.json"
This example connects to Microsoft Graph, reads the App Configuration policy from the specified JSON file, and creates the policy in Intune.
Imports Intune App Protection policies from a specified JSON file.
Import-EmMdmAppProtection [-ImportPath] <String> [[-AuthObject] <EmMdmAuthBase>] [[-graphApiVersion] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
ImportPath | The file path to the JSON file containing the App Protection policy to import. This parameter is mandatory. | true | true (ByValue, ByPropertyName\) | ||
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- [string] The cmdlet accepts a file path as input.
- [string] The cmdlet outputs the ID of the created policy.
The cmdlet uses the following functions: - Connect-EmMdmGraph - Add-EmMdmAppProtection - Disconnect-MgGraph
EXAMPLE 1
Import-EmMdmAppProtection -ImportPath "C:\Backup\AppProtections\Policy.json"
This example connects to Microsoft Graph, reads the App Protection policy from the specified JSON file, and creates the policy in Intune.
Imports Intune Compliance policies from a specified JSON file.
Import-EmMdmCompliance [-ImportPath] <String> [[-AuthObject] <EmMdmAuthBase>] [[-graphApiVersion] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
ImportPath | The file path to the JSON file containing the Compliance policy to import. This parameter is mandatory. | true | true (ByValue, ByPropertyName\) | ||
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- [string] The cmdlet accepts a file path as input.
- [pscustomobject] The cmdlet outputs the result of the created policy.
The cmdlet uses the following functions: - Connect-EmMdmGraph - Add-EmMdmCompliance - Disconnect-MgGraph
EXAMPLE 1
Import-EmMdmCompliance -ImportPath "C:\Backup\CompliancePolicies\Policy.json"
This example connects to Microsoft Graph, reads the Compliance policy from the specified JSON file, and creates the policy in Intune.
Imports Intune Device Configuration policies from a specified JSON file.
Import-EmMdmConfiguration [-ImportPath] <String> [[-AuthObject] <EmMdmAuthBase>] [[-graphApiVersion] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
ImportPath | The file path to the JSON file containing the Device Configuration policy to import. This parameter is mandatory. | true | true (ByValue, ByPropertyName\) | ||
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- [string] The cmdlet accepts a file path as input.
- [string] The cmdlet outputs the result of the created policy.
The cmdlet uses the following functions: - Connect-EmMdmGraph - Add-EmMdmConfiguration - Disconnect-MgGraph
EXAMPLE 1
Import-EmMdmConfiguration -ImportPath "C:\Backup\DeviceConfigurations\Policy.json"
This example connects to Microsoft Graph, reads the Device Configuration policy from the specified JSON file, and creates the policy in Intune.
Imports Intune Endpoint Security policies from a specified JSON file.
Import-EmMdmEndpointSecurity [-ImportPath] <String> [[-AuthObject] <EmMdmAuthBase>] [[-graphApiVersion] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
ImportPath | The file path to the JSON file containing the Endpoint Security policy to import. This parameter is mandatory. | true | true (ByValue, ByPropertyName\) | ||
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- [string] The cmdlet accepts a file path as input.
- [PSCustomObject] The cmdlet outputs the result of the created policy.
The cmdlet uses the following functions: - Connect-EmMdmGraph - Add-EmMdmEndpointSecurity - Disconnect-MgGraph
EXAMPLE 1
Import-EmMdmEndpointSecurity -ImportPath "C:\Backup\EndpointSecurity\Policy.json"
This example connects to Microsoft Graph, reads the Endpoint Security policy from the specified JSON file, and creates the policy in Intune.
Imports Intune Settings Catalog policies from a specified JSON file.
Import-EmMdmSettingsCatalog [-ImportPath] <String> [[-AuthObject] <EmMdmAuthBase>] [[-graphApiVersion] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
ImportPath | The file path to the JSON file containing the Settings Catalog policy to import. This parameter is mandatory. | true | true (ByValue, ByPropertyName\) | ||
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- [string] The cmdlet accepts a file path as input.
- [void] This cmdlet does not output any objects.
The cmdlet uses the following functions: - Connect-EmMdmGraph - Add-EmMdmSettingsCatalog - Disconnect-MgGraph
EXAMPLE 1
Import-EmMdmSettingsCatalog -ImportPath "C:\Backup\SettingsCatalog\Policy.json"
This example connects to Microsoft Graph, reads the Settings Catalog policy from the specified JSON file, and creates the policy in Intune.
Imports Intune Software Update policies from a specified JSON file.
Import-EmMdmSoftwareUpdate [-ImportPath] <String> [[-AuthObject] <EmMdmAuthBase>] [[-graphApiVersion] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Name | Alias | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
ImportPath | The file path to the JSON file containing the Software Update policy to import. This parameter is mandatory. | true | true (ByValue, ByPropertyName\) | ||
AuthObject | The authentication object used for connecting to Microsoft Graph. | false | false | ||
graphApiVersion | The version of the Microsoft Graph API to use. Valid values are "beta" and "v1.0". The default value is "beta". | false | false | beta | |
WhatIf | wi | false | false | ||
Confirm | cf | false | false |
- [string] The cmdlet accepts a file path as input.
- [string] The ID of the created policy.
The cmdlet uses the following functions: - Connect-EmMdmGraph - Add-EmMdmConfiguration - Disconnect-MgGraph
EXAMPLE 1
Import-EmMdmSoftwareUpdate -ImportPath "C:\Backup\SoftwareUpdates\Policy.json"
This example connects to Microsoft Graph, reads the Software Update policy from the specified JSON file, and creates the policy in Intune.