Hi,
I want to enable SharePoint audit setting using PS. I am executing following steps. However I am getting below mentioned error.
Note: This command is working fine with my on premise environment. Any help would be appreciated.
Command:
$site = Get-SPOSite "SiteURL" $site.Audit.AuditFlags = [Microsoft.SharePoint.SPAuditMaskType]::Update $site.Audit.Update()
Error:
Unable to find type [Microsoft.SharePoint.SPAuditMaskType]: make sure that the assembly containing this type is loaded.At line:1 char:1
+ $site.Audit.AuditFlags = [Microsoft.SharePoint.SPAuditMaskType]::Update
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Microsoft.SharePoint.SPAuditMaskType:TypeName) [], RuntimeException
+ FullyQualifiedErrorId : TypeNotFound