Tag: script
-
Search/Identify blocked file types in SharePoint
In SharePoint 2016 On-Prem, Microsoft has reduced the number of blocked file types from previous versions of SharePoint. It is totally different than the SharePoint 2010 / 2013. In SharePoint 2013, there are 105 default file types that are blocked by default but in SharePoint 2016, this number goes all the way down to 6.…
-
Display Service Applications along with app-pool names and user accounts used for them.
Get-SPServiceApplication | Select Name, @{Name="SPAppPoolName"; Expression={$_.ApplicationPool.Name}}, @{Name="IISAppPoolName"; Expression={$_.ApplicationPool.Id}}, @{Name="ProcessAccountName"; Expression={$_.ApplicationPool.ProcessAccountName}} By a minor tweak to the command – Get-SPWebApplication, you could use this for web application as well. though the process account name is not available.
-
Powershell – SharePoint Deployment Standard Init Call
In a typical SharePoint deployment script, I would have the following part to make sure that all required ammunitions are there: # Load SharePoint PS snap-in. # Nothing will occur if the Add-Type cmdlet tries to load an assembly multiple times, because .NET Framework assemblies only load once. Add-Type -AssemblyName "Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Function…
-
Double quote in PowerShell – backtick (`) & here-string approach
Favourite is to use the double quotation marks to create an expanding string. I then escape the required internal quotation marks by using the backtick (`) character, as shown here: PS C:\> $c = "My name is `"$env:UserName`"" PS C:\> $c My name is "ed" PS C:\> Another way to get double quotation marks into…
-
Quick installation of telnet-client on windows server 2012
Execute the following Powershell command: install-windowsfeature "telnet-client" The window also verify that my smtp server is ready to serve request. telnet readylab.net 25
-
Developer productivity–script to deploy an assembly quickly to Global Assembly Cache (GAC)
Very often we want to deploy the assembly to GAC and test our work, without having to follow a quick deployment process. here is a script which does the assembly deployment (uninstall the old one and install a new version). $ProgamFiles_x86 = "$env:ProgramFiles (x86)" #configure GacUtil environment set-alias gacutil "$ProgamFiles_x86\Microsoft SDKs\Windows\v7.0A\bin\GacUtil.exe" # un-install the old…
-
PowerShell script to file browse, change file attribute, restore SharePoint site backup
Here is a nice little utility (written using PowerShell script) which I use to restore a site backup time to time. Some features of this script are: 1. Displays a file browse dialog to select a file (see – Invoke-FileBrowser) 2. Removes the read-only attribute on the file (see – Remove-Readonly), this is required as…