timmcmic / DLConversionV2

MIT License
44 stars 9 forks source link

ERROR: Unable to create powershell session. #39

Closed A-J-A closed 2 years ago

A-J-A commented 2 years ago

Just testing and getting the error: Calling import-PowerShellSession ERROR: Unable to create powershell session. Any recommendation on fix or what to check?

timmcmic commented 2 years ago

Can you attach the log file?

A-J-A commented 2 years ago

thanks for the reply, BVC04.log

timmcmic commented 2 years ago

Certainly not very exciting.

Let's do this to test and make sure exchange is ready to go. Make sure you're not running this from the exchange management shell.

Open powershell

$cred = get-credential (use the exchange credential in the same format you specified)

$session = new-pssession -configuration microsoft.exchange -credential $cred -connectionURI https://exchangename/powershell (for example https://webmail.contoso.com/powershell) -authentication Basic -allowRedirection:$TRUE

Import-psSession $session

Does that work.

Tim

A-J-A commented 2 years ago

Hi Tim, it looks like the issues is due to the -connectionURI using https, this work $session = new-pssession -configuration microsoft.exchange -credential $cred -connectionURI http://ex13mb3.xmail.co.uk/powershell -Authentication Kerberos -allowRedirection:$TRUE

but changing to https has an error, is there a switch to use http?

timmcmic commented 2 years ago

There is not. Your servers should have self signed certs to the names - and I assume you have at least one server in the environment with a public certificate and a name - like webmail.contoso.com.

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: A-J-A @.> Sent: Wednesday, March 2, 2022 10:45 AM To: timmcmic/DLConversionV2 @.> Cc: Tim McMichael @.>; Comment @.> Subject: Re: [timmcmic/DLConversionV2] ERROR: Unable to create powershell session. (Issue #39)

Hi Tim, it looks like the issues is due to the -connectionURI using https, this work $session = new-pssession -configuration microsoft.exchange -credential $cred -connectionURI http://ex13mb3.xmail.co.uk/powershellhttps://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fex13mb3.xmail.co.uk%2Fpowershell&data=04%7C01%7Ctimmcmic%40microsoft.com%7C6f63eb30eddf474247fb08d9fc639cf2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637818327034902947%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=p3uTRB%2B2uzxKp%2BL6cztLkt%2F2XvE5LoJCoidQdNHERG0%3D&reserved=0 -Authentication Kerberos -allowRedirection:$TRUE

but changing to https has an error, is there a switch to use http?

- Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftimmcmic%2FDLConversionV2%2Fissues%2F39%23issuecomment-1057075543&data=04%7C01%7Ctimmcmic%40microsoft.com%7C6f63eb30eddf474247fb08d9fc639cf2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637818327034902947%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=LTwQQsk%2BO7UHUxn1NrPWBMe3lrFPSg%2BK81EGyc9glO4%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKGTN6NT6RT3PRVOAIFMWGDU56EH3ANCNFSM5PVGRABA&data=04%7C01%7Ctimmcmic%40microsoft.com%7C6f63eb30eddf474247fb08d9fc639cf2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637818327034952934%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=MxTFskxicVvYk51VQN6GNaIOZwZMH8QLKBXydm34%2FD8%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Ctimmcmic%40microsoft.com%7C6f63eb30eddf474247fb08d9fc639cf2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637818327034952934%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=cU9hauWOO2TxdhUw664yMVEobDgeXjyfzhTE%2F1XMWM4%3D&reserved=0 or Androidhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7Ctimmcmic%40microsoft.com%7C6f63eb30eddf474247fb08d9fc639cf2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637818327034952934%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=FAcJu%2B%2Bod6c7eeAo6zCNecnXSoC48C0fLW7uvNoYcjo%3D&reserved=0. You are receiving this because you commented.Message ID: @.**@.>>

A-J-A commented 2 years ago

thank you for confirming, yes we have self signed and public cert added to Exchange,

timmcmic commented 2 years ago

If the public cert is added to exchange - and enabled for web services - you should be able to use whatever name would resolve to that.

If the name does not resolve in internal DNS - go ahead and put a host file entry in for it.

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: A-J-A @.> Sent: Wednesday, March 2, 2022 10:59 AM To: timmcmic/DLConversionV2 @.> Cc: Tim McMichael @.>; Comment @.> Subject: Re: [timmcmic/DLConversionV2] ERROR: Unable to create powershell session. (Issue #39)

thank you for confirming, yes we have self signed and public cert added to Exchange,

- Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftimmcmic%2FDLConversionV2%2Fissues%2F39%23issuecomment-1057090058&data=04%7C01%7Ctimmcmic%40microsoft.com%7Cc93c425a34ea4192bfe108d9fc659f43%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637818335664496667%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=wfyx1uNvF0DrK9A520kmZOotmrxKU2QkDcgck%2Fd3qcY%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKGTN6KLO7JG6AVM344ECOTU56F5ZANCNFSM5PVGRABA&data=04%7C01%7Ctimmcmic%40microsoft.com%7Cc93c425a34ea4192bfe108d9fc659f43%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637818335664496667%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=aGzE3saJWeNDtH%2FRP3z%2BHFcjXs0H7YrZY8O9QdOkh1A%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Ctimmcmic%40microsoft.com%7Cc93c425a34ea4192bfe108d9fc659f43%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637818335664546655%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=B%2BiwzB2rk7E9CYZ1txVLJQ14Sgu6JvhkrlUzu4IDtro%3D&reserved=0 or Androidhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7Ctimmcmic%40microsoft.com%7Cc93c425a34ea4192bfe108d9fc659f43%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637818335664546655%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Qo6n%2Fs1XPZRjUly0x%2FLtAky%2FwJVLdjw0Vw4OVD%2FGAbU%3D&reserved=0. You are receiving this because you commented.Message ID: @.**@.>>

A-J-A commented 2 years ago

Hi Tim, Now working thank you for the assistance, time to start testing 😊

timmcmic commented 2 years ago

Excellent!


From: A-J-A @.> Sent: Thursday, March 3, 2022 11:58 AM To: timmcmic/DLConversionV2 @.> Cc: Tim McMichael @.>; Comment @.> Subject: Re: [timmcmic/DLConversionV2] ERROR: Unable to create powershell session. (Issue #39)

Hi Tim, Now working thank you for the assistance, time to start testing 😊

— Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftimmcmic%2FDLConversionV2%2Fissues%2F39%23issuecomment-1058260890&data=04%7C01%7Ctimmcmic%40microsoft.com%7C5b741b3ebbcd4711ad1808d9fd3702d5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637819234996542044%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=qcD4m4GULdUEP2Xcie%2BYXxhc221ULW6KKBKBhQ8ClRo%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKGTN6P53G6RIG4FDHYYGY3U6DVSPANCNFSM5PVGRABA&data=04%7C01%7Ctimmcmic%40microsoft.com%7C5b741b3ebbcd4711ad1808d9fd3702d5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637819234996592029%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=AO5uiqRhncTjla3SZSyKomDCa0mW4vCTMIAX4E5r2t4%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Ctimmcmic%40microsoft.com%7C5b741b3ebbcd4711ad1808d9fd3702d5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637819234996592029%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=rsgfPWISTUg5dKbErfYlhYS2EvGJvm3qXMWQVKOoXUU%3D&reserved=0 or Androidhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7Ctimmcmic%40microsoft.com%7C5b741b3ebbcd4711ad1808d9fd3702d5%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637819234996592029%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=oG6xSuFCppWTGUXz%2Bw8TX%2Fnog3B9u6uG53qasAsdxvs%3D&reserved=0. You are receiving this because you commented.Message ID: @.***>