PowerShell – Automated Remote Desktop Services (RDS) web feed.
Recently I wanted to make it easy for users to add a Remote Desktop Service web feed through group policies. I created a script that needs to be run in the user context.
Recently I wanted to make it easy for users to add a Remote Desktop Service web feed through group policies. I created a script that needs to be run in the user context.
Lately I found out that the following doesn’t always work, I had problem with returning all users in a group.
1 |
Get-ADGroupMember -Recursive |
So I have created a small PowerShell function that basically does the same thing. Use it free of charge!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
Function Get-ADNestedGroups { [cmdletbinding()] Param ( [Parameter(Mandatory=$true, HelpMessage="Please provide a valid identity.")]$Identity ) #Get all groups/users of the root group. $Members = Get-ADGroupMember -Identity $Identity; #Foreach member in the group. Foreach($Member in $Members) { #If the member is a group. If($Member.ObjectClass -eq "group") { #Run the function again against the group. $Users += Get-ADNestedGroups -Identity $Member.distinguishedName; } Else { #Add the user to the object array. $Users += @($Member); } } #Return the users Return ,$Users; } $Users = Get-ADNestedGroups -Identity "Domain Users"; |
Looong time, no posts.
Just wrote a PowerShell function that can convert text documents into PDF format. You need Microsoft Office Word installed.
Use free of charge:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
#Convert input (file) into a PDF document (requires Word installed). Function ConvertTo-PDFFile { Param ( [string]$Source, [string]$Destionation ) #Get the content of the file. $Source = Get-Content $Source -Encoding UTF8; #Required Word Variables. $ExportFormat = 17; $SaveOption = 0 #Create a hidden Word window. $WordObject = New-Object -ComObject word.application; $WordObject.Visible = $false; #Add a Word document. $DcoumentObject = $WordObject.Documents.Add(); #Put the text into the Word document. $WordSelection = $WordObject.Selection; $WordSelection.TypeText($Source); #Set the page orientation to landscape. $DcoumentObject.PageSetup.Orientation = 1; #Export the PDF file and close without saving a Word document. $DcoumentObject.ExportAsFixedFormat($Destionation,$ExportFormat); $DcoumentObject.close([ref]$SaveOption); $WordObject.Quit(); } ConvertTo-PDFFile -Source "C:\Path\To\My\File.txt" -Destionation "C:\Path\To\Exported\PDF\file.pdf"; |
Lately I had the issue that SolarWinds Orion was detecting an expiring certificate on one of our servers. I have replaced every certificate on the server and double checked (of thought!) that the old certificate was deleted. But it was still complaining about an expiring date on a certificate I couldn’t find. I checked the event logs and found the event 15021, which told me something was still wrong.
I found out that a certificate was on a binding with “netsh show http certssl” in a command prompt.
If you have spread the MySite and a web application into separated SharePoint Web Application and both of these is using AD FS for authentication. You maybe noticed that you are not able to load user profile thumbnails from the MySite. This is because a token is not issued from the MySite web application and Cross-Origin Resource Sharing (CORS) that is a security measure.
But luckily Microsoft have acknowledged this and have added a PowerShell command that allows to load pictures/resources from other SharePoint web applications on the same farm.
It’s possible to set the performance for a SharePoint search crawl with PowerShell. This becomes handy if you are on a developing environment where performance isn’t crucial.
There are 3 valid modes:
Use the following PowerShell commands in a SharePoint Management Shell.
Disk-based caching controls caching for binary large objects (BLOBs) such as image, sound, and video files, as well as code fragments. Disk-based caching is extremely fast and eliminates the need for database round trips. BLOBs are retrieved from the database once and stored on the Web client. Further requests are served from the cache and trimmed based on security.
Disk-based caching is disabled by default. To enable and customize the disk-based cache, you can run the following script.
If you have a lot of unused (not linked) group policy object, you can delete it with the following PowerShell script.
If you need take ownership of an employees OneDrive, run the following PowerShell code.
Some requirements before running the script.
If you ever need to disable SharePoint throttling on a specific list instead of the whole web-application.