powershell
17 TopicsSelfeServe License Request Administation
Hello Microsoft Community! In our Org , using the powershell module MSCommerce, we have already set the AllowSelfServicePurchase policy to Disabled for all products as we do not want our Members to purchase licenses or sign up for trials on their own. This has not stopped our Members from making requests for licenses. We'd like to have our Members utilize our established process for requesting licenses vs using SelfServe. Is it possible to stop this altogether vs only being able to disable the purchasing function? Here is an example of our policy status and the weekly digest email we just received.Solved373Views0likes3CommentsUnable to Remove-SPOUser from personal sharepoints properly
Hello, I had to add a global administrator account literally on every single personal sharepoint, asSite Collection Administrators, to delete a user from each personal sharepoint, with a certain email but associated with a old sharepoint ID (the user was re-added to our Office 365 and he had issues when other were sharing links from personal sharepoint to him, access denied even with the right email, because he have now other sharepoint ID). Now I want to remove thatglobal administrator account from every personal sharepoint (using: Remove-SPOUser) , using a global administrator account A to remove the global administrator account B that I've added everywhere (Account B was added with Account A login with: Set-SPOUser)(otherwise will get: Remove-SPOUser : A user may not remove his or her own account from a site collection.), but cannot do that because, seems like I need to use an account that is already a Site Collection Administrator, to perform this action, so I am unable to leave just the Primary Site Collection Administrator (the own user). Over web sharepoint admin center, I can remove and add everyone using Account A, even remove Account A fromSite Collection Administrators, it simply doesn't work in the same way when connected overConnect-SPOService. Please advise how can I remove thatAccount B, and leave only thePrimary Site Collection Administrator asSite Collection Administrator?384Views0likes1CommentCan't change PasswordExpirationPolicy of all users with Update-MgUser
Hello, Ive got into a problem where we disabled Password expiration in the GUI but some account keep having it enabled when you look with Powershell. Microsoft provides a guide where they explain hot to set all users policy to never expire, sadly it doesn't work, I've tried it in several Tenants already. Here is the link to the guide: https://learn.microsoft.com/en-us/microsoft-365/admin/add-users/set-password-to-never-expire?view=o365-worldwide The command: Get-MGuser -All | Update-MgUser -PasswordPolicies DisablePasswordExpiration The error when the command is used: Update-MgUser_UpdateViaIdentityExpanded: The pipeline has been stopped. Exception: InputObject has null value for InputObject.UserId I know that you should set a UserID as a scope for it to work, but this isn't possible as far as I know on update-mguser. Please help me find a solution to update everyone's PasswordExpirationPolicy to never expire. I was thinking about creating a script that goes through every userid and performs the action, but my knowledge isn't as advanced to create it.Solved469Views0likes1CommentCannot create Information Barrier Policy
Hi, I have created two segments within Information Barriers in Microsoft Purview. I have then tried to create a Policy that blocks one segment from the other using both the UI and PowerShell, but I get the same error every time. "Could not run the command New-InformationBarrierPolicy. Cause of the problem: The parameter(s) ModerationAllowed of the cmdlet New-ExoInformationBarrierPolicy is not allowed for the app 00000007-0000-0ff1-ce00-000000000000" Am I missing something? Is anyone else seeing this, or is it just me? Right now, I can create many policies at all.Solved1.4KViews0likes4CommentsAzure automation account script error
Hi I have an azure automation account and all runbooks are failing. I don't know why. As a test I only ran this command, and it fails too. $cred = Get-AutomationPSCredential -Name "Name" Import-Module ExchangeOnlineManagement Connect-ExchangeOnline -Credential $cred This is the job Exception log: Connecting to remote server outlook.office365.com failed with the following error message : Bad Request For more information, see the about_Remote_Troubleshooting Help topic. (Connecting to remote server outlook.office365.com failed with the following error message : Bad Request For more information, see the about_Remote_Troubleshooting Help topic.) Any ideasSolved1.3KViews0likes3CommentsHow to manage unmanaged Lists (My Lists)?
Hi all, Lists can be stored in two locations: - SharePoint Site - My Lists In this question I am talking about My Lists. As far as I understand My Lists are stored in the specific OneDrive of the user. Scenario: A huge, heavily used List is stored in My Lists (I know this is not how it is supposed to be) and the creator of the List leaves the company. How do I manage this unmanged List? In Forms there is a process a Global Admin can use to get back the control. But for Lists I didn't find something so far.Solved733Views0likes2CommentsLoop parameters missing after PowerShell update
I'm trying to give a few users access to the new Loop collaboration platform and I'm getting stuck trying to update SharePoint parameters so that file sharing can be enabled in Teams and SharePoint. I have updated to the most recent version of the Management Shell for SharePoint Online. When I run the command Get-SPOTenant, I don't see the IsLoopEnabled or IsWBFluidEnabled parameters. Our SharePoint Online version is 16.0.0.23508 Any suggestions would be appreciated.748Views0likes0CommentsExchange Online help with powershell
So long story short. We have 9 domains in our org and when people transfer from department to department we are required to disable their old account and create a new one or sometimes we have contractors that become FTE's. Most of the time the department allows them to take their mail but because it's a new account I have to migrate the mailbox in the recycle bin to the new one under the new account. I have scripted this process and everything is working except when I try to catch and use the Exchange GUID in a variable. After I grab it, I do a Write-Host and it prints just fine but when it gets to New-MailboxRestoreRequest to use the GUID, I get the following: I can copy and paste the output of the Write-Host in place of the variables and it works. I just don't want to have to do that every time. Here is the script with identifying information stripped. Thanks in advance for the help. #Connections Connect-ExchangeOnline $Session = New-PSSession –ConfigurationName Microsoft.Exchange –ConnectionUri http://exchangeServer/PowerShell/ -authentication Kerberos Import-PSSession $Session -disablenamechecking set-adserversettings -viewentireforest $true #Set your variables $upn='Jane.Doe' $oldDomain='thisdomain.com' $newDomain='thatdomain.com' #Get Old and New GUIDS $oldEmailGUID=get-exomailbox -SoftDeletedMailbox -UserPrincipalName $upn'@'$oldDomain -PropertySets all | select name,primarysmtpaddress,exchangeguid,legacy*,whencreated,whenchanged Write-Host $oldEmailGUID.ExchangeGuid $oldEmailGUID=$oldEmailGUID.ExchangeGuid $newEmailGUID=get-exomailbox -UserPrincipalName $upn'@'$newDomain -PropertySets all | select name,primarysmtpaddress,exchangeguid,legacy*,whencreated,whenchanged Write-Host $newEmailGUID.ExchangeGuid $newEmailGUID=$newEmailGUID.ExchangeGuid Start-Sleep -Seconds 5 #Copy Old mailbox to New Mailbox New-MailboxRestoreRequest -Name $upn -SourceMailbox $oldEmailGUID -TargetMailbox $newEmailGUID -AllowLegacyDNMismatch -CompletedRequestAgeLimit 7 -ConflictResolutionOption keepall –LargeItemLimit 5 #-BadItemLimit 2000 Start-Sleep -Seconds 5 #Add X500 forwarding address **must first remove from old account through AD #Get Old x500 $oldEmailX500=Get-exomailbox -SoftDeletedMailbox -UserPrincipalName $upn'@'$oldDomain -PropertySets all | select name,primarysmtpaddress,exchangeguid,legacy*,whencreated,whenchanged Write-Host $oldEmailX500.LegacyExchangeDN $fullX500ValueCheck='@{Add = X500:'+$oldEmailX500.LegacyExchangeDN+'}' Write-Host $fullX500ValueCheck #Add X500 forwarding address **must first remove from old account through AD Set-remoteMailbox -Identity $upn'@'$newDomain -EmailAddresses @{Add = 'X500:'+$oldEmailX500.LegacyExchangeDN} -verbose ##### Show Restore Status #### #get restore guid $mailboxRestoreRequestStatsGUID=Get-MailboxRestoreRequest -Name $upn Write-host $mailboxRestoreRequestStatsGUID.RequestGuid #Check Status **update guid from previous step Get-MailboxRestoreRequestStatistics -Identity $mailboxRestoreRequestStatsGUID.RequestGuid | select targetmailboxidentity,status,statusdetail,failuretype,message,estimatedtransfersize,bytestransferred,EstimatedTransferItemCount,itemstransferred,percentcomplete,*stalled*,overalldurationSolved1.4KViews0likes2CommentsPowershell Script to Generate eDiscovery Case
Hello Everyone, Currently working on a series of scripts that I will be using to administrate Office365 regularly for my clients, including one to generate the eDiscovery search and export. In my script I found that the param -OneDriveLocation for New-ComplianceSearch comes up as an invalid parameter. The whole premise behind this is to automate the user decommissioning process as much as possible, even if the last step is to log into the compliance center and download the clickonce application to export the zipped up export, we can easily save 30~60 minutes per user decommissioning we have to run, with an average of 3 a day it allows my techs on our service desk to work on other tickets during that time frame.Solved3.8KViews0likes2Comments