New-MgDeviceManagementAuditEvent
Create new navigation property to auditEvents for deviceManagement
Syntax
CreateExpanded (Default)
New-MgDeviceManagementAuditEvent
[-ResponseHeadersVariable <string>]
[-Activity <string>]
[-ActivityDateTime <datetime>]
[-ActivityOperationType <string>]
[-ActivityResult <string>]
[-ActivityType <string>]
[-Actor <IMicrosoftGraphAuditActor>]
[-AdditionalProperties <hashtable>]
[-Category <string>]
[-ComponentName <string>]
[-CorrelationId <string>]
[-DisplayName <string>]
[-Id <string>]
[-Resources <IMicrosoftGraphAuditResource[]>]
[-Break]
[-Headers <IDictionary>]
[-HttpPipelineAppend <SendAsyncStep[]>]
[-HttpPipelinePrepend <SendAsyncStep[]>]
[-Proxy <uri>]
[-ProxyCredential <pscredential>]
[-ProxyUseDefaultCredentials]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Create
New-MgDeviceManagementAuditEvent
-BodyParameter <IMicrosoftGraphAuditEvent>
[-ResponseHeadersVariable <string>]
[-Break]
[-Headers <IDictionary>]
[-HttpPipelineAppend <SendAsyncStep[]>]
[-HttpPipelinePrepend <SendAsyncStep[]>]
[-Proxy <uri>]
[-ProxyCredential <pscredential>]
[-ProxyUseDefaultCredentials]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Create new navigation property to auditEvents for deviceManagement
Permissions
Permission type
Permissions (from least to most privileged)
Delegated (work or school account)
DeviceManagementApps.ReadWrite.All,
Delegated (personal Microsoft account)
Not supported
Application
DeviceManagementApps.ReadWrite.All,
Examples
Example 1: Code snippet
Import-Module Microsoft.Graph.DeviceManagement.Administration
$params = @{
"@odata.type" = "#microsoft.graph.auditEvent"
displayName = "Display Name value"
componentName = "Component Name value"
actor = @{
"@odata.type" = "microsoft.graph.auditActor"
type = "Type value"
auditActorType = "Audit Actor Type value"
userPermissions = @(
"User Permissions value"
)
applicationId = "Application Id value"
applicationDisplayName = "Application Display Name value"
userPrincipalName = "User Principal Name value"
servicePrincipalName = "Service Principal Name value"
ipAddress = "Ip Address value"
userId = "User Id value"
}
activity = "Activity value"
activityDateTime = [System.DateTime]::Parse("2016-12-31T23:59:51.6363086-08:00")
activityType = "Activity Type value"
activityOperationType = "Activity Operation Type value"
activityResult = "Activity Result value"
correlationId = "52effe71-fe71-52ef-71fe-ef5271feef52"
resources = @(
@{
"@odata.type" = "microsoft.graph.auditResource"
displayName = "Display Name value"
modifiedProperties = @(
@{
"@odata.type" = "microsoft.graph.auditProperty"
displayName = "Display Name value"
oldValue = "Old Value value"
newValue = "New Value value"
}
)
type = "Type value"
auditResourceType = "Audit Resource Type value"
resourceId = "Resource Id value"
}
)
category = "Category value"
}
New-MgDeviceManagementAuditEvent -BodyParameter $params
This example shows how to use the New-MgDeviceManagementAuditEvent Cmdlet.
Parameters
-Activity
Friendly name of the activity.
Parameter properties
Type: System.String
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ActivityDateTime
The date time in UTC when the activity was performed.
Parameter properties
Type: System.DateTime
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ActivityOperationType
The HTTP operation type of the activity.
Parameter properties
Type: System.String
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ActivityResult
The result of the activity.
Parameter properties
Type: System.String
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ActivityType
The type of activity that was being performed.
Parameter properties
Type: System.String
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Actor
A class containing the properties for Audit Actor.
To construct, see NOTES section for ACTOR properties and create a hash table.
Parameter properties
Type: Microsoft.Graph.PowerShell.Models.IMicrosoftGraphAuditActor
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-AdditionalProperties
Additional Parameters
Parameter properties
Type: System.Collections.Hashtable
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-BodyParameter
A class containing the properties for Audit Event.
To construct, see NOTES section for BODYPARAMETER properties and create a hash table.
Parameter properties
Type: Microsoft.Graph.PowerShell.Models.IMicrosoftGraphAuditEvent
Supports wildcards: False
DontShow: False
Parameter sets
Create
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-Break
Wait for .NET debugger to attach
Parameter properties
Type: System.Management.Automation.SwitchParameter
Default value: False
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Category
Audit category.
Parameter properties
Type: System.String
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ComponentName
Component name.
Parameter properties
Type: System.String
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: System.Management.Automation.SwitchParameter
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-CorrelationId
The client request Id that is used to correlate activity within the system.
Parameter properties
Type: System.String
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DisplayName
Event display name.
Parameter properties
Type: System.String
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
Optional headers that will be added to the request.
Type: System.Collections.IDictionary
Supports wildcards: False
DontShow: False
(All)
Position: Named
Mandatory: False
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-HttpPipelineAppend
SendAsync Pipeline Steps to be appended to the front of the pipeline
Parameter properties
Type: Microsoft.Graph.PowerShell.Runtime.SendAsyncStep [ ]
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-HttpPipelinePrepend
SendAsync Pipeline Steps to be prepended to the front of the pipeline
Parameter properties
Type: Microsoft.Graph.PowerShell.Runtime.SendAsyncStep [ ]
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Id
The unique identifier for an entity.
Read-only.
Parameter properties
Type: System.String
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Proxy
The URI for the proxy server to use
Parameter properties
Type: System.Uri
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ProxyCredential
Credentials for a proxy server to use for the remote call
Parameter properties
Type: System.Management.Automation.PSCredential
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ProxyUseDefaultCredentials
Use the default credentials for the proxy
Parameter properties
Type: System.Management.Automation.SwitchParameter
Default value: False
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Resources
Resources being modified.
To construct, see NOTES section for RESOURCES properties and create a hash table.
Parameter properties
Type: Microsoft.Graph.PowerShell.Models.IMicrosoftGraphAuditResource [ ]
Supports wildcards: False
DontShow: False
Parameter sets
CreateExpanded
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
Optional Response Headers Variable.
Type: System.String
Supports wildcards: False
DontShow: False
Aliases: RHV
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-WhatIf
Runs the command in a mode that only reports what would happen without performing the actions.
Parameter properties
Type: System.Management.Automation.SwitchParameter
Supports wildcards: False
DontShow: False
Aliases: wi
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Microsoft.Graph.PowerShell.Models.IMicrosoftGraphAuditEvent
{{ Fill in the Description }}
System.Collections.IDictionary
{{ Fill in the Description }}
Outputs
Microsoft.Graph.PowerShell.Models.IMicrosoftGraphAuditEvent
{{ Fill in the Description }}
Notes
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties.
For information on hash tables, run Get-Help about_Hash_Tables.
ACTOR <IMicrosoftGraphAuditActor>: A class containing the properties for Audit Actor.
[(Any) <Object>]: This indicates any property can be added to this object.
[ApplicationDisplayName <String>]: Name of the Application.
[ApplicationId <String>]: AAD Application Id.
[AuditActorType <String>]: Actor Type.
[IPAddress <String>]: IPAddress.
[ServicePrincipalName <String>]: Service Principal Name (SPN).
[UserId <String>]: User Id.
[UserPermissions <String[]>]: List of user permissions when the audit was performed.
[UserPrincipalName <String>]: User Principal Name (UPN).
BODYPARAMETER <IMicrosoftGraphAuditEvent>: A class containing the properties for Audit Event.
[(Any) <Object>]: This indicates any property can be added to this object.
[Id <String>]: The unique identifier for an entity.
Read-only.
[Activity <String>]: Friendly name of the activity.
[ActivityDateTime <DateTime?>]: The date time in UTC when the activity was performed.
[ActivityOperationType <String>]: The HTTP operation type of the activity.
[ActivityResult <String>]: The result of the activity.
[ActivityType <String>]: The type of activity that was being performed.
[Actor <IMicrosoftGraphAuditActor>]: A class containing the properties for Audit Actor.
[(Any) <Object>]: This indicates any property can be added to this object.
[ApplicationDisplayName <String>]: Name of the Application.
[ApplicationId <String>]: AAD Application Id.
[AuditActorType <String>]: Actor Type.
[IPAddress <String>]: IPAddress.
[ServicePrincipalName <String>]: Service Principal Name (SPN).
[UserId <String>]: User Id.
[UserPermissions <String[]>]: List of user permissions when the audit was performed.
[UserPrincipalName <String>]: User Principal Name (UPN).
[Category <String>]: Audit category.
[ComponentName <String>]: Component name.
[CorrelationId <String>]: The client request Id that is used to correlate activity within the system.
[DisplayName <String>]: Event display name.
[Resources <IMicrosoftGraphAuditResource[]>]: Resources being modified.
[AuditResourceType <String>]: Audit resource's type.
[DisplayName <String>]: Display name.
[ModifiedProperties <IMicrosoftGraphAuditProperty[]>]: List of modified properties.
[DisplayName <String>]: Display name.
[NewValue <String>]: New value.
[OldValue <String>]: Old value.
[ResourceId <String>]: Audit resource's Id.
RESOURCES <IMicrosoftGraphAuditResource[]>: Resources being modified.
[AuditResourceType <String>]: Audit resource's type.
[DisplayName <String>]: Display name.
[ModifiedProperties <IMicrosoftGraphAuditProperty[]>]: List of modified properties.
[DisplayName <String>]: Display name.
[NewValue <String>]: New value.
[OldValue <String>]: Old value.
[ResourceId <String>]: Audit resource's Id.