none
Getting RPC server is unaviailable while extracting an html report using Get-GPO Report

    Question

  • I am getting RPC server is unavailable while running the below command:

    Get-GPOReport -Name TestGPO1 -ReportType HTML -Path C:\GPOReports\GPOReport1.html

    Monday, March 7, 2016 6:54 PM

All replies

  • Good Day
    Did you check if you have the permissions to connect to that server?
    Is the server up?
    Regards
    Monday, March 7, 2016 6:56 PM
  • I am logged on the domain controller itself. I have the permissions also there are no issues with the server. Only this command is not working.
    Monday, March 7, 2016 7:52 PM
  • Are you able to run a Get-Service or Get-Process commands?
    Just to make sure it is happening only with the Get-GPOReport cmdlet
    Monday, March 7, 2016 8:04 PM
  • Yes Get-Service works. Also if I just type Get-GPOReport, it prompts me for the GUID of the policy. However this command which I mentioned before does not work.
    Monday, March 7, 2016 8:13 PM
  • Hi,

    I would suggest you have a try running following the command:

    $domain = Get-ADDomain

    $GPOs = Get-GPO –name TestGPO1 -server server.domain.com

    Get-GPOReport -name ($GPO.displayname) -ReportType Html -Path "C:\GPOReports\GPOReport1.html"}

    Regards,

    Wendy


    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, March 8, 2016 8:48 AM
    Moderator
  • Getting this error while running the above command:

    Get-GPOReport : Cannot validate argument on parameter 'Name'. Value cannot be null.
    Parameter name: gpoName
    At line:1 char:21
    + Get-GPOReport -name ($GPO.displayname) -ReportType Html -Path "C:\gpoextract\def ...

    Wednesday, March 9, 2016 12:08 PM
  • > Get-GPOReport -name ($GPO.displayname) -ReportType Html -Path
    > "C:\GPOReports\GPOReport1.html"}
     
    Should read
     
    Get-GPOReport -name $($GPO.displayname) -ReportType Html -Path
    "C:\GPOReports\GPOReport1.html"
     
    Wednesday, March 9, 2016 12:41 PM
  • Hello Martin,

    I am trying correct command as you stated above, still getting the error:

    Get-GPOReport : Cannot validate argument on parameter 'Name'. Value cannot be null.
    Parameter name: gpoName

    Wednesday, March 9, 2016 7:26 PM
  • Am 08.03.2016 um 09:48 schrieb Wendy Jiang:
    > $domain = Get-ADDomain
    >
    > $GPOs = Get-GPO –name TestGPO1 -server server.domain.com
    >
    > Get-GPOReport -name ($GPO.displayname) -ReportType Html -Path
    > "C:\GPOReports\GPOReport1.html"}
    >
     
    Wendy, this is wrong. It grabs $GPOs, then refers to $GPO which is not
    initialized... $domain is not even used at all :()
     
    $GPO = Get-GPO –name TestGPO1 -server server.domain.com
    Get-GPOReport -name $($GPO.displayname) -ReportType Html -Path
    "C:\GPOReports\GPOReport1.html"}
     
    Thursday, March 10, 2016 9:49 AM
  • Hi,
    Please have a try again using the following script :
    $GPOs = Get-GPO –name TestGPO1 -server server.domain.com
    $GPOs | ForEach-Object {
    $dname = $_.DisplayName
    Get-GPOReport -name ($dname) -ReportType Html -Path "C:\ GPOReport1\GPOReport1.html"}

    I have just tested in my lab environment and it is working. Please replace the name

    @ Martin,

    Appreciate your hint.

    Regards,
    Wendy


    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Wednesday, March 16, 2016 8:50 AM
    Moderator
  • > $GPOs | ForEach-Object {
    > $dname = $_.DisplayName
    > Get-GPOReport -name ($dname) -ReportType Html -Path "C:\
    > GPOReport1\GPOReport1.html"}
     
    Now you are overwriting the report with each next GPO :) (Ok, it's only
    one...)
     
    Since the pipeline is all in PoSh, I suggest the following for future use:
     
    get-gpo "GPO Name" -Server xyz.corp.com | % { Get-GPOReport $($_.ID)
    -ReportType Html -Path \$($_.DisplayName).html }
     
    Wednesday, March 16, 2016 10:32 AM