I am new to scripting.
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic –AllowRedirection
Import-PSSession $Session
Search-AdminAuditLog -UserIds User1,User2,User3 | Select-Object ObjectModified,CmdletName,CmdletParameters,Caller | Export-Csv \\Server\path\Reports\admin_audit$((Get-Date).ToString(' MM-dd-yyyy')).csv
Remove-PSSession $Session
The output file "admin_audit(date).csv" has 4 columns, ObjectModified, CmdletName, CmdletParameters,and Caller.
In the Caller column, it puts the path for the user in each cell.
| namprd04.prod.outlook.com/Microsoft Exchange Hosted Organizations/international.onmicrosoft.com/User1 |
| namprd04.prod.outlook.com/Microsoft Exchange Hosted Organizations/international.onmicrosoft.com/User1 |
| namprd04.prod.outlook.com/Microsoft Exchange Hosted Organizations/international.onmicrosoft.com/User3 |
| namprd04.prod.outlook.com/Microsoft Exchange Hosted Organizations/international.onmicrosoft.com/User2 |
namprd04.prod.outlook.com/Microsoft Exchange Hosted Organizations/international.onmicrosoft.com/User3 I want to remove everything from the first "N" to the last /, and exclude the Username (User1,2,3). The text in bold. thanks |