community
54 TopicsUnable to Connect to ExchangeOnline
So we have MFA enabled on our Office 365 accounts. From my Windows 10 computer, I can connect to the ExchangeOnlineManagement module without issue. However, on my DC I installed Powershell 7.0.3, then successfully installed the ExchangeOnlineManagement module. I can successfully import the module, however when I attempt to connect to it I get the below error. Any ideas? PS C:\Windows\System32> Connect-ExchangeOnline -UserPrincipalName MyUsername -ShowProgress $true ---------------------------------------------------------------------------- The module allows access to all existing remote PowerShell (V1) cmdlets in addit ion to the 9 new, faster, and more reliable cmdlets. |--------------------------------------------------------------------------| | Old Cmdlets | New/Reliable/Faster Cmdlets | |--------------------------------------------------------------------------| | Get-CASMailbox | Get-EXOCASMailbox | | Get-Mailbox | Get-EXOMailbox | | Get-MailboxFolderPermission | Get-EXOMailboxFolderPermission | | Get-MailboxFolderStatistics | Get-EXOMailboxFolderStatistics | | Get-MailboxPermission | Get-EXOMailboxPermission | | Get-MailboxStatistics | Get-EXOMailboxStatistics | | Get-MobileDeviceStatistics | Get-EXOMobileDeviceStatistics | | Get-Recipient | Get-EXORecipient | | Get-RecipientPermission | Get-EXORecipientPermission | |--------------------------------------------------------------------------| To get additional information, run: Get-Help Connect-ExchangeOnline or check htt ps://aka.ms/exops-docs Send your product improvement suggestions and feedback to exocmdletpreview@servi ce.microsoft.com. For issues related to the module, contact Microsoft support. D on't use the feedback alias for problems or support issues. ---------------------------------------------------------------------------- New-ExoPSSession: C:\Users\jwcitadmin\Documents\PowerShell\Modules\ExchangeOnlin eManagement\2.0.3\ExchangeOnlineManagement.psm1:426 Line | 426 | . PSSession = New-ExoPSSession -ExchangeEnvironmentName $ExchangeEnviro . | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Could not load type 'System.Security.Cryptography.SHA256Cng' from | assembly 'System.Core, Version=4.0.0.0, Culture=neutral, | PublicKeyToken=b77a5c561934e089'..28KViews1like10CommentsSecure Way to store lots of credentials using powershell
Dear Community I wanted to ask if there is any way I can store lots of creedentials while still being able to use them in Powershell? I dont want to enter anything in a popup window, because there are way to many credentials to to that by hand. Is it possible that I can just put them in some kind of file and then get the wanted informations (while the file or its contents are somehow encrypted)? Thanks in advance MartinSolved21KViews0likes5CommentsPowershell Script to move Profile, Mapped Drives, Printers, and Files
I'm trying to find some example scripts to migrate Windows 10 user profiles to a new computer, but haven't had any luck with my searches. I just started a new job and have about 60 desktops to swap for employees. The new systems are ready for the domain, but I would like to have a script that helps migrate drive mappings, local and network printers, bookmarks, and files to either a network drive or USB-attached storage. I just want the process to be seamless for me and the users. I may need to write some other code to identify and log installed software and ip addresses. (since some clients may have static ips that need DHCP records updated to reflect their new MAC address). I don't have a lot of experience with this kind of thing because I was always using PS for AD/Exchange administration. All systems will be running Windows 10 this round. Is it possible to just copy the entire Users directory to the new PC or does that cause issues? (I've never tried it and don't have time to run into issues during the migration)17KViews0likes4CommentsImport-CSV data into to set variables in a script
Good morning all, I don't know much about PowerShell but I am trying to create an script that variable data from each row in CSV file and input data to create the mailbox. For example: CSV: Username, Servername, ServerCode Bob,jane, DC101, 101 Input variable to the following: "Enable-Mailbox -identity "Domianname\User.name" - Database MBDB01-code -PrimarySMTPAddress "User.Name@email.address" -domain controller FQDN_servername" Where User.name = CSV.Username code = CSV.servercode FQDN_servername = CSV.servername Then the result will either out put the Enable-Mailbox line to .txt file or run each Enable-mailbox line RegardsSolved17KViews0likes2CommentsWhy does my generated JSON have too many "\\"?
Dear Community I have a Powershell Script which generates a JSON file with data in it. I have a problem with this file though. It generates double the amount of "\\"! Do you know how I could solve this? Here is my Code to generate the JSON File: [ordered]@{ pcname='ENTER HERE'; share='\\ENTER HERE\C$'; filename='ENTER HERE'; destfilepath='some\folder'; destfile='$in.share\$in.destfilepath\$in.filename'; RDdestfile='C:\$in.destfilepath\'; Username="ENTER HERE"; Password="ENTER HERE"; EncryptedPassword="" } | ConvertTo-Json | Out-File "$secFile" $secFile is just a path to save the file to. Just tell me if you need this too. The output JSON file looks liek this though: { "pcname": "ENTER HERE", "share": "\\\\ENTER HERE\\C$", "filename": "ENTER HERE", "destfilepath": "some\\folder", "destfile": "$in.share\\$in.destfilepath\\$in.filename", "RDdestfile": "C:\\$in.destfilepath\\", "Username": "ENTER HERE", "Password": "ENTER HERE", "EncryptedPassword": "" } Greetings Martin Edit: I also posted this question in the PowerShell.org Forum and Stackoverflow, just so you know https://powershell.org/forums/topic/why-does-my-generated-json-have-too-many/ https://stackoverflow.com/questions/63446524/why-does-my-generated-json-have-too-manySolved8.8KViews0likes2CommentsIntegrating WSL with Windows 7 64bit with Power Shell
Hello Microsoft Community! This is my first post. I am trying to get WSL 1.0 to function with windows 7. For some reason, I get errors in Power Shell when trying to run the script to enable WSL. I have found information that says that dism.exe has two versions, one version for 32 bit and one version for 64 bit. I have tried the script for both file locations as the locations are supposed to designate which version of the .exe gets used. Within Power Shell, the error is the same. I cannot service a 64 bit system with the 32 bit operation. There are log files for both attempts, I have yet to inspect both of the log files to see if the information is the same. I have very minimal experience with scripting or interpreting the information within the log files. I am trying to get FreeCAD to run on Windows 7 64 bit. It worked with windows 10, but WSL is a part of windows 10 as a windows feature that can just be activated with an option. With this PC, I have windows 7 and cannot currently upgrade to Windows 10 or 11. Does anyone have any idea how I can get Windows 7 to support my App?Solved8.4KViews0likes2CommentsNew-ApplicationAccessPolicy
Any idea if this cmdlet has been retired or replaced by RBAC, I'm trying to execute this command but I'm getting the not recognized error in Powershell. Please suggest if I'm missing any modules which needs to be installed prior to execution. thanks in advanceSolved5.3KViews0likes4CommentsWelcome to the Windows PowerShell Community!
By popular demand we have created a Windows PowerShell community on the Microsoft Tech Community! Please post questions, best practices and answer questions posted here! Make sure you use labels suggested in each post to help people find your posts. We are looking for suggestions on new spaces to create here so let us know if you have recommendations on what we can do here to make this community a great place for everyone to learn more about Windows PowerShell.5.2KViews15likes13Comments