Office
33 TopicsA powershell 7 script that will grant a global admin rights to users OneDrive
Hello, I'm wondering if this has ever been done, and if yes, can someone either give me the script or point me to where it is. I have a CSV of users which I need to grant a global admin access to their One Drives. I've scoured the internet for scripts that will iterate through my CSV and grant me access but I am always getting errors no matter what I try to do. I am using PS7 for this. Has this ever been done? If yes can someone please give me a script that can do it. Thanks46Views0likes2CommentsChange work hours
Hello, I am trying to change users' work hours as I would do via the web interface. However, I am unable to find a way to do this using PowerShell. Iβve seen suggestions to use Set-MailboxCalendarConfiguration, such as: Set-MailboxCalendarConfiguration -Identity email address removed for privacy reasons -WorkingHoursStartTime "09:00:00" -WorkingHoursEndTime "17:00:00" However, I need to set different working hours for each day, and I canβt find any parameters that would allow me to do this. Is this possible? Do I need to use Update-MgUserMailboxSetting for this? Thank you, Alejandro23Views0likes1CommentError PowerShell 300-1015 (80)
Hello, using P.Shell for office installation, with ODT, it gives me the following error shown in the photo, or opening the console in any folder with the right mouse button "open the P.S. window here" gives an error: Missing termination character in the string: ". + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString While if I run the command on the desktop, the window opens normally! Thanks15Views0likes0CommentsAdding External Users in-bulk to: Microsoft Teams & Private Channel(s) within the Team
We have a customer who requires over 350 external users (their customers) to be added / invited into a Team which has been created. "Half" of the users need to be added into "private channel a", and the other "Half" need to be added into "private channel b". We have attempted to add the users via various PowerShell scripts, however none of these scripts that we have been provided with have worked for various reasons. I have been unable to locate any native methods for this within the MS 365 admin centre, therefore believe that the only way to achieve this is by PowerShell scripting. Example of the most recent script we have is as follows, omitting the creation of the private channel(s) as they have already been created - see below: We require assistance with the actual script itself to: Add users into the team from a CSV of their email addresses. Assign the users to the correct private channel. Note - users will be added in 2 batches - 1 per private channel, so we just require scripting that can be modified to achieve this. # Install the Microsoft Teams PowerShell Module Install-Module -Name PowerShellGet -Force -AllowClobber Install-Module -Name MicrosoftTeams -Force -AllowClobber # Connect to Microsoft Teams Connect-MicrosoftTeams # Define the team name and path to the CSV file $teamName = "Your Team Name" $csvPath = "C:\path\to\your\users.csv" # Get the GroupId of the team $team = Get-Team -DisplayName $teamName $groupId = $team.GroupId # Import users from the CSV file $users = Import-Csv $csvPath # Add external users to the team foreach ($user in $users) { Add-TeamUser -GroupId $groupId -User $user.Email } # Define the private channel name $privateChannelName = "Private Channel Name" # Create the private channel New-TeamChannel -GroupId $groupId -DisplayName $privateChannelName -MembershipType Private # Get the ChannelId of the private channel $channel = Get-TeamChannel -GroupId $groupId -DisplayName $privateChannelName $channelId = $channel.Id # Add users to the private channel foreach ($user in $users) { Add-TeamChannelUser -GroupId $groupId -User $user.Email -ChannelId $channelId }70Views0likes0CommentsPrinter Driver not found in DriverStore even though the file is there
I have a script that installs printer drivers onto a machine. It has worked perfectly for years up until yesterday. This is the script: # This script works on Windows 8 or newer since the add-printer cmdlets are't available on Windows 7. # Download the HP Univeral Printing PCL 6 driver. # To find\extract the .inf file, run 7-zip on the print driver .exe and go to the folder in Powershell and run this command: get-childitem *.inf* |copy-item -destination "C:\examplefolder" Otherwise it's hard to find the .inf files. $driversrc="\\10.1.1.21\sysprep\Printer Drivers\ApeosC2570\ffac7070pcl6220420w636iml\Software\PCL\amd64\Common\001\FFSOBPCLA.inf" Write-Host "Reading from here: $driversrc" $driver = "FF Apeos C2570 PCL 6" $address = "10.1.1.31" $portnamesuffix = "_1" $portname = "$address$portnamesuffix" $name = "Admin Apeos C2570" $sleep = "3" # The invoke command can be added to specify a remote computer by adding -computername. You would need to copy the .inf file to the remote computer first though. # This script has it configured to run on the local computer that needs the printer. # The pnputil command imports the .inf file into the Windows driverstore. # The .inf driver file has to be physically on the local or remote computer that the printer is being installed on. Invoke-Command {pnputil.exe -a $driversrc } Add-PrinterDriver -Name $driver Start-Sleep $sleep #Get the infos of all printer $Printers = Get-WmiObject -Class Win32_Printer $PrinterPorts = Get-PrinterPort $PrinterName = $name # This creates the TCP\IP printer port. It also will not use the annoying WSD port type that can cause problems. # WSD can be used by using a different command syntax though if needed. Try { Write-Verbose "Get the specified printer info." $Printer = $PrinterPorts | Where{$_.Name -eq "$portname"} If (! $Printer) { Write-Verbose "Adding printer port." Add-PrinterPort -Name $portname -PrinterHostAddress $address Write-Host "$portname has been successfully added." } Else { Write-Warning "Port already exists." } } Catch { $ErrorMsg = $_.Exception.Message Write-Host $ErrorMsg -BackgroundColor Red } start-sleep $sleep Try { Write-Verbose "Get the specified printer info." $Printer = $Printers | Where{$_.Name -eq "$PrinterName"} If (! $Printer) { Write-Verbose "Adding printer." Add-Printer -DriverName $driver -Name $name -PortName $portname Write-Host "$PrinterName has been successfully added." } Else { Write-Warning "$PrinterName is already installed!." } } Catch { $ErrorMsg = $_.Exception.Message Write-Host $ErrorMsg -BackgroundColor Red } Start-Sleep $sleep #Update the infos of all printer $Printers = Get-WmiObject -Class Win32_Printer Try { Write-Verbose "Get the specified printer info." $Printer = $Printers | Where{$_.Name -eq "$PrinterName"} If($Printer) { Write-Verbose "Setting the default printer." $Printer.SetDefaultPrinter() | Out-Null Write-Host "$PrinterName has been successfully set as the default printer." } Else { Write-Warning "Cannot find $PrinterName, can't set it as the default printer." } } Catch { $ErrorMsg = $_.Exception.Message Write-Host $ErrorMsg -BackgroundColor Red } Try { If($Printer) { Write-Verbose "Setting printer defaults." Set-PrintConfiguration -PrinterName $PrinterName -Color $false -DuplexingMode TwoSidedLongEdge | Out-Null Write-Host "$PrinterName has printing defaults set." } Else { Write-Warning "Cannot find the specified printer, can't set printer defaults." } } Catch { $ErrorMsg = $_.Exception.Message Write-Host $ErrorMsg -BackgroundColor Red } Get-PrintConfiguration -PrinterName $PrinterName # This prints a list of installed printers on the local computer. This proves the newly added printer works. Write-Warning "You must manually set the printer Output Color Preference to Black and White. Do it now!" get-printer |Out-Printer -Name $name Write-Host "If all went well a page should be printing out on the printer now." When I run the commands manually, the error persists. This is the error: Add-PrinterDriver : The specified driver does not exist in the driver store. dd-PrinterDriver -Name "[Name]" -InfPath "[Path]" PS C:\Windows\System32] At line:1 char:1 + Add-PrinterDriver -Name "[Name]" -InfPath "[Path]" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (MSFT_PrinterDriver:ROOT/StandardCimv2/MSFT_PrinterDriver) [Add-PrinterDri ver], CimException + FullyQualifiedErrorId : HRESULT 0x80070705,Add-PrinterDriver I want to know if there is a reason that the driver is not getting found in the DriverStore despite my being able to locate it. And whether others have this issue, it appears as if it's a windows issue.1KViews0likes9CommentsHow to grant permissions on behalf of the organization Script
Hello everyone! We generated a necessary Script to create a Principal API/APP/Service in Entra ID, and assign some delegated and application permissions. However, I need to consent to these permissions on behalf of the organization, during the Script itself. I have tried several times, in different ways, but all without success. Does anyone know how this can be done? If it can be done? And could you help me with this? Thank you all. Best regards331Views0likes1CommentUsing powershell to create folders within users onedrive
Hi all, I'm experiencing several issues with different PowerShell versions when trying to create folders in OneDrive for users in bulk. PowerShell 5.1 does not recognize Connect-PnPOnline. PowerShell 7 does not recognize Connect-SPOService. I have been following the instructions from this guide, which worked on my previous device. However, Iβm unable to get it to work on my new device. My goal is to create folders within specific users' OneDrive accounts. Could you please assist me in resolving this? Thank you!2.7KViews0likes26CommentsWhat Causes π π €π π π π π π π π ’ Online Error Code 101 and How Can It Be Fixed?
π π €π π π π π π π π ’ Online Error Code 101 typically occurs due to a problem connecting to your bank account. Causes include incorrect bank login credentials, outdated browser settings, or connectivity issues. To fix it: Verify Login Information: Ensure your bank login credentials are correct. Update Browser: Use the latest version of your web browser. Clear Cache and Cookies: Clear your browser's cache and cookies. Check Bank's Website: Verify there are no issues with the bank's website. Reconnect Account: Disconnect and reconnect your bank account in π π €π π π π π π π π ’. If the issue persists, contact π π €π π π π π π π π ’ support.902Views0likes1CommentPowerShell script to change font of office apps
Hi, We are using Microsoft 365 for Enterprise for delivery office apps to users via Microsoft Intune. Currently the default font for all office apps is Calibri and now users want that it should change to Arial, 11 font. Is there a way in Powershell to make that change. I have been suggested ways to do it with .net objects or Interop. Can someone please share a sample PowerShell script or a full script to make that change. Thanks, Ashish Arya33KViews0likes18CommentsError - Connect-ExchangeOnline Error Acquiring Token: System.Net.Http.HttpRequestException
Error Connect-ExchangeOnline Error Acquiring Token: System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Remote name could not be resolved: 'server.proxy.local'680Views0likes1Comment