timmcmic / DLConversionV2

MIT License
44 stars 9 forks source link

I get this issue when I run your module either on the Exchange server itself or a machine on the same subnet #46

Closed Russtoleum closed 2 years ago

Russtoleum commented 2 years ago

New-PSSession : [exchangeserver.company.org] Connecting to remote server exchangeserver.company.org failed with the following

error message : The WinRM client sent a request to an HTTP server and got a response saying the requested HTTP URL was

not available. This is usually returned by a HTTP server that does not support the WS-Management protocol. For more

information, see the about_Remote_Troubleshooting Help topic.

At C:\Program Files\WindowsPowerShell\Modules\DLConversionV2\New-PowershellSession.ps1:119 char:34

(Here is line 119: $sessiontoimport=New-PSSession -ConfigurationName $configurationName -ConnectionUri $connectionURI -Credential $credentials -AllowRedirection:$allowRedirection -Authentication $authenticationType -name $PowershellSessionName)

I have confirmed that WinRM is enabled and the ports are open on the firewall on the exchange server. I can open a pssession from the machine I am trying to run this on to the exchange server and I have even tried to run this module on the exchange server itself but I continue to get this error.

timmcmic commented 2 years ago

Have you followed the guidance to ensure that basic authentication is enabled on the powershell virtual directory?

Are you setting up the session by hand using basic auth and the same url?

Tim

============================== Timothy J. McMichael Senior Support Escalation Engineer @.**@.> (980)-776-7465

Hours: Sunday – Wednesday 08:00 – 16:00 eastern time zone.

Manager: Tom Roughley @.**@.>)

Premier Support - (800)-936-3100 Broad Commercial Support - (800)-936-4900

==============================


From: Russtoleum @.> Sent: Wednesday, March 30, 2022 3:47 PM To: timmcmic/DLConversionV2 @.> Cc: Subscribed @.***> Subject: [timmcmic/DLConversionV2] I get this issue when I run your module either on the Exchange server itself or a machine on the same subnet (Issue #46)

New-PSSession : [exchangeserver.company.org] Connecting to remote server exchangeserver.company.org failed with the following

error message : The WinRM client sent a request to an HTTP server and got a response saying the requested HTTP URL was

not available. This is usually returned by a HTTP server that does not support the WS-Management protocol. For more

information, see the about_Remote_Troubleshooting Help topic.

At C:\Program Files\WindowsPowerShell\Modules\DLConversionV2\New-PowershellSession.ps1:119 char:34

(Here is line 119: $sessiontoimport=New-PSSession -ConfigurationName $configurationName -ConnectionUri $connectionURI -Credential $credentials -AllowRedirection:$allowRedirection -Authentication $authenticationType -name $PowershellSessionName)

I have confirmed that WinRM is enabled and the ports are open on the firewall on the exchange server. I can open a pssession from the machine I am trying to run this on to the exchange server and I have even tried to run this module on the exchange server itself but I continue to get this error.

— Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftimmcmic%2FDLConversionV2%2Fissues%2F46&data=04%7C01%7Ctimmcmic%40microsoft.com%7Cfcf611fc07534331f48008da12861515%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637842664338568875%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=%2Bc41F5ghMBCoityDdMVl2zxo1NjEZOXqNPeEboF%2FTg8%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKGTN6K47EHJDC76E5IVDULVCSVT7ANCNFSM5SC7TA6A&data=04%7C01%7Ctimmcmic%40microsoft.com%7Cfcf611fc07534331f48008da12861515%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637842664338568875%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=NkTYYaRh1JGina9C141sv9l4ZVOn0cAs2O0NlqjvPIU%3D&reserved=0. You are receiving this because you are subscribed to this thread.Message ID: @.***>

tco-bfisk commented 2 years ago

First off, I didn't use my local Exchange server. All user mailboxes were migrated off, exchange hybrid never configured, old connectors removed. It was only in place as a way for the help desk to modify groups via a GUI using Exchange Web Console on the old server (hence the project that led me down this road). But I figured this would be a good time to share my "wrapper" scripts I made to use the module. Maybe it will help?

I've used the last few versions of Tim's module on different machines with my "wrapper" and it seems to be working for me. It's rudimentary and probably has some fluff that I took from my previous attempts at creating Powershell Scripts, which I now know how much of an amateur I am after seeing Tim's scripting!

I run from a member server in the domain where the source groups are located. My AADC server is in a different forest (across AD Trust). I first ran on a DC in the source domain, then another member server, and another. I use the following two scripts to do my multiple group migrations.

The first is Prepare-Migration.ps1. This script installs and updates modules as well as sets connection variables. I have a section at the top where you can hard code variable defaults. You are then prompted for everything. The only thing I don't have built into the script is the generation and setup of the certificate with O365 for PS authentication but the instructions are in there commented out.

I have a second script I use called Perform-Migration.ps1. This script actually performs the migration. It will search for the OU name specified, get all distribution groups from that OU, and then feed into Tim's migration module. This script also has a section for hard coding default values. If you've got lots of nested groups, you will have to rerun them multiple times to catch all the nested children.

To run, I'll open a new PowerShell window and run the first script with a dot space to keep the variables in session: . .\Prepare-Migration.ps1

I run the second script .\Perform-Migration.ps1 so the variable values are not set in the current session. Otherwise, if you ran like the Prepare script and you moved onto another group or reran to catch nested groups that failed before, the existing values would be used.

Thank you Tim for this awesome module! I successfully finished a major part of my migration project with just under 900 distribution groups used across 15 countries.

Prepare-Migration.ps1.txt Perform-Migration.ps1.txt

Russtoleum commented 2 years ago

Timothy, thank you! Basic auth was indeed disabled for the powershell Virtual Directory. I think that was my final hurdle. Though I still am having errors, I am going to try and figure it out before I ask for more direction as I am sure you are quite busy.

timmcmic commented 2 years ago

Feel free to send the logs over and we can see where they're erroring.

Tim

============================== Timothy J. McMichael Senior Support Escalation Engineer @.**@.> (980)-776-7465

Hours: Sunday - Wednesday 08:00 - 16:00 eastern time zone.

Manager: Tom Roughley @.**@.>)

Premier Support - (800)-936-3100 Broad Commercial Support - (800)-936-4900

==============================

From: Russtoleum @.> Sent: Monday, April 4, 2022 1:54 PM To: timmcmic/DLConversionV2 @.> Cc: Tim McMichael @.>; Comment @.> Subject: Re: [timmcmic/DLConversionV2] I get this issue when I run your module either on the Exchange server itself or a machine on the same subnet (Issue #46)

Timothy, thank you! Basic auth was indeed disabled for the powershell Virtual Directory. I think that was my final hurdle. Though I still am having errors, I am going to try and figure it out before I ask for more direction as I am sure you are quite busy.

- Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftimmcmic%2FDLConversionV2%2Fissues%2F46%23issuecomment-1087846279&data=04%7C01%7Ctimmcmic%40microsoft.com%7C95f8edc8f7e044c7f92a08da166423ee%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637846916606838489%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=bnq0YHqyiOTFNTz%2FICmYxswcDdE7X24RJ7RZ4IFM2vI%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKGTN6MTPAGBG7H5MGGMDTTVDMUETANCNFSM5SC7TA6A&data=04%7C01%7Ctimmcmic%40microsoft.com%7C95f8edc8f7e044c7f92a08da166423ee%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637846916606838489%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=ihJCVN8OmTcY8%2FnFBb5ltDOb809dWG0fMB%2BK3D%2BYKEM%3D&reserved=0. You are receiving this because you commented.Message ID: @.**@.>>

Russtoleum commented 2 years ago

[4/4/2022 12:24:15 PM] - Attepmting to find the user via distinguished name. [4/4/2022 12:24:15 PM] - Error getting AD object. Sleep and try again.

[91mGet-ADObject: Variable: 'dn' found in expression: $dn is not defined. [0m

[91mOut-LogFile: C:\Users\Documents\PowerShell\Modules\DLConversionV2\2.5.16\Get-NormalizedDN.ps1:141 [96mLine | [96m 141 |  Out-LogFile -string $_ -isError:$TRUE [96m |  ~~~~~~~~~ [91m | Variable: 'dn' found in expression: $dn is not defined.

Is that enough?

timmcmic commented 2 years ago

Nah I need to see what the entire call looks like.

@.**@.> you can zip and email the logs safely.

Tim

============================== Timothy J. McMichael Senior Support Escalation Engineer @.**@.> (980)-776-7465

Hours: Sunday – Wednesday 08:00 – 16:00 eastern time zone.

Manager: Tom Roughley @.**@.>)

Premier Support - (800)-936-3100 Broad Commercial Support - (800)-936-4900

==============================

From: Russtoleum @.> Sent: Monday, April 4, 2022 2:28 PM To: timmcmic/DLConversionV2 @.> Cc: Tim McMichael @.>; Comment @.> Subject: Re: [timmcmic/DLConversionV2] I get this issue when I run your module either on the Exchange server itself or a machine on the same subnet (Issue #46)

[4/4/2022 12:24:15 PM] - Attepmting to find the user via distinguished name. [4/4/2022 12:24:15 PM] - Error getting AD object. Sleep and try again.

[91mGet-ADObject: �[91mVariable: 'dn' found in expression: $dn is not defined. [0m

[91mOut-LogFile: �[0mC:\Users\Documents\PowerShell\Modules\DLConversionV2\2.5.16\Get-NormalizedDN.ps1:141 [96mLine | [96m 141 | �[0m �[96mOut-LogFile -string $_ -isError:$TRUE�[0m [96m | �[91m ~~~~~~~~~ [91m�[96m | �[91mVariable: 'dn' found in expression: $dn is not defined.

Is that enough?

— Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftimmcmic%2FDLConversionV2%2Fissues%2F46%23issuecomment-1087877094&data=04%7C01%7Ctimmcmic%40microsoft.com%7C7effa761f6d44bc55d9308da1668db72%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637846936855919230%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=iY%2FTcttFG9q1UcYX7vTpXhWn8%2BcoSautAp7h1YVyX3M%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKGTN6OHD7J6W3C53M4NWU3VDMYDHANCNFSM5SC7TA6A&data=04%7C01%7Ctimmcmic%40microsoft.com%7C7effa761f6d44bc55d9308da1668db72%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637846936855919230%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=WWzncs5uRka%2F6a89CaS3D%2FnTt0S2h14yK8edxSkfSyY%3D&reserved=0. You are receiving this because you commented.Message ID: @.**@.>>

timmcmic commented 2 years ago

Dlconversionv2 at service dot microsoft dot com

============================== Timothy J. McMichael Senior Support Escalation Engineer @.**@.> (980)-776-7465

Hours: Sunday – Wednesday 08:00 – 16:00 eastern time zone.

Manager: Tom Roughley @.**@.>)

Premier Support - (800)-936-3100 Broad Commercial Support - (800)-936-4900

==============================

From: Russtoleum @.> Sent: Monday, April 4, 2022 2:28 PM To: timmcmic/DLConversionV2 @.> Cc: Tim McMichael @.>; Comment @.> Subject: Re: [timmcmic/DLConversionV2] I get this issue when I run your module either on the Exchange server itself or a machine on the same subnet (Issue #46)

[4/4/2022 12:24:15 PM] - Attepmting to find the user via distinguished name. [4/4/2022 12:24:15 PM] - Error getting AD object. Sleep and try again.

[91mGet-ADObject: �[91mVariable: 'dn' found in expression: $dn is not defined. [0m

[91mOut-LogFile: �[0mC:\Users\Documents\PowerShell\Modules\DLConversionV2\2.5.16\Get-NormalizedDN.ps1:141 [96mLine | [96m 141 | �[0m �[96mOut-LogFile -string $_ -isError:$TRUE�[0m [96m | �[91m ~~~~~~~~~ [91m�[96m | �[91mVariable: 'dn' found in expression: $dn is not defined.

Is that enough?

— Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftimmcmic%2FDLConversionV2%2Fissues%2F46%23issuecomment-1087877094&data=04%7C01%7Ctimmcmic%40microsoft.com%7C7effa761f6d44bc55d9308da1668db72%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637846936855919230%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=iY%2FTcttFG9q1UcYX7vTpXhWn8%2BcoSautAp7h1YVyX3M%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKGTN6OHD7J6W3C53M4NWU3VDMYDHANCNFSM5SC7TA6A&data=04%7C01%7Ctimmcmic%40microsoft.com%7C7effa761f6d44bc55d9308da1668db72%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637846936855919230%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=WWzncs5uRka%2F6a89CaS3D%2FnTt0S2h14yK8edxSkfSyY%3D&reserved=0. You are receiving this because you commented.Message ID: @.**@.>>

Russtoleum commented 2 years ago

Just emailed from my work email.