powershell-intune-samples icon indicating copy to clipboard operation
powershell-intune-samples copied to clipboard

Error when running script and giving path to WindowsDefenderATPOnboarding.XML

Open clarkeyi opened this issue 4 years ago • 3 comments

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
    

clarkeyi avatar Jan 25 '21 17:01 clarkeyi

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

davefalkus avatar Jan 25 '21 21:01 davefalkus

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.

clarkeyi avatar Jan 25 '21 23:01 clarkeyi

Hi @clarkeyi,

I've tried without quotes and the policy added correctly, could you provide an example of a path that fails?

image

Thanks

Dave

davefalkus avatar Jan 26 '21 11:01 davefalkus