[Scenario]
- After replacing Exchange server, account creation script did not work
- The error message is "Please connect to Rotorks On-Premise Exchange (Please connect to Rotorks On-Premise Exchange)" which seems a customized error message
[Objectives]
- Examine related PowerShell scripts and remediate them
[Remediation]
- Go to the Azure automation account where account creation script belong to
- The script is ran on on-premise system via hybrid-worker. So figure out what is the on-premise server by check hybrid worker groups
Automation Account --> Group Name --> Hybrid worker group
- Remote control the on-premis server then open PowerShell
- In the PowerShell script, customized fucntions are seen but cannot figure out where they are from
- Ran "$env:PSmodulePath" to figure out the module library path
PS C:\Users\admin.jyoon> $env:PSModulePath
C:\Users\admin.jyoon\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\Common Files\Skype for
Business Online\Modules\;C:\Program Files\Microsoft\HybridConnectionManager 0.7\;C:\Program Files\Microsoft Monitoring Agent\Agent\PowerShell\;C:\Program Files (x86)\Microsoft Endpoint Manage
r\AdminConsole\bin;C:\Program Files\Microsoft Monitoring Agent\Agent\AzureAutomation\7.3.1840.0
- Seems "C:\Program Files\WindowsPowerShell\Modules" is the most probable candidate thus go to the path and search library files
- Open "Rotork.Exchange.Management" folder and open "Rotork.Exchange.Management.psm1"
- The customized functions, Function New-RotorkExchangeMailbox and Function Get-RotorkExchangeMailbox are in the library. Now updated the server name
- After changing server name, the script works!
'ICT' 카테고리의 다른 글
[VMWare] Restoring Datastorage from Virtual Machine (0) | 2024.03.25 |
---|---|
[DFS] Set DFS Primary Server (0) | 2024.03.19 |
[ServiceNow] Inbound Action for Backup Fail Issue (0) | 2024.03.06 |
[SQL] Procedure for Creating a New Account in Canteen System (0) | 2024.03.04 |
[PowerShell] Sending ActiveDirectory User List Weekl (0) | 2024.02.29 |
댓글