Error when running script and giving path to WindowsDefenderATPOnboarding.XML
Hi
When I run the MacOS_MDATP_Deployment_Add_Assign.ps1 or Add.ps1 script, after I put in the path to the XML file I receive the error below. The configuration profiles do get applied to Endpoint Manager, but the onboarding XML seems empty.
get-content : Access to the path 'C:\temp' is denied. At C:\Users\IanClarke\OneDrive\MacOS_MDATP_Deployment_Add_Assign.ps1:680 char:22
- ... boardingXMLFile = get-content "$OnboardingXMLFilePath" -Encoding byte
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~- CategoryInfo : PermissionDenied: (C:\temp:String) [Get-Content], UnauthorizedAccessException
- FullyQualifiedErrorId : GetContentReaderUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetContentCommand
Exception calling "ToBase64String" with "1" argument(s): "Value cannot be null. Parameter name: inArray" At C:\Users\user\OneDrive\MacOS_MDATP_Deployment_Add_Assign.ps1:681 char:1
- $OnboardingXML = [System.Convert]::ToBase64String($OnboardingXMLFile)
-
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : ArgumentNullException
Hi @clarkeyi,
Can you provide how your providing the path to the onboarding file? Are you providing in quotes e.g. "c:\temp\file.xml" or c:\temp\file.xml (without quotes) so we can check for a repro.
Thanks
Dave
Hello
I am typing the command without quotes.
Thanks Ian
From: davefalkus [email protected] Sent: 25 January 2021 21:47 To: microsoftgraph/powershell-intune-samples [email protected] Cc: clarkeyi [email protected]; Mention [email protected] Subject: Re: [microsoftgraph/powershell-intune-samples] Error when running script and giving path to WindowsDefenderATPOnboarding.XML (#164)
Hi @clarkeyihttps://github.com/clarkeyi,
Can you provide how your providing the path to the onboarding file? Are you providing in quotes e.g. "c:\temp\file.xml" or c:\temp\file.xml (without quotes) so we can check for a repro.
Thanks
Dave
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/microsoftgraph/powershell-intune-samples/issues/164#issuecomment-767133745, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACICZBLWKZT6DHBXVUGQ6BDS3XRGLANCNFSM4WSDATFQ.
Hi @clarkeyi,
I've tried without quotes and the policy added correctly, could you provide an example of a path that fails?

Thanks
Dave