Get User Ad Properties using Windows PowerShell

Instead of using AD Powershell, below script can be used  to get any user details from On-Prem Active Directory any vanilla powershell console.

$root = [ADSI]”
$SAMName = ‘username’
$searcher = new-object System.DirectoryServices.DirectorySearcher($root)
$searcher.filter = “(&(objectClass=user)(sAMAccountName= $SAMName))”
$user = $searcher.findall()

This can be extended for multiple users if needed.

Add the below line to get the list of properties


To get the count



Partial HTML on Print of group list using html2canvas

Using html2canvas to print a group list (a office UI fabric component ) wrapped with a div.
All the items does not appear in the print when grouped list items goes beyond the screen(the item count is high).
Need to scroll down and once entire HTML is loaded then can be printed.

Development was done under below:

  1. NPM 4.2.0
  2. type script 2.3.2
  3. react: 15.6.2,
  4. react-dom: 15.6.2,
  5. react-router-dom: ^4.2.2
  • Browser & version: Chrome (Version 64.0.3282.186 (Official Build) (32-bit))
  • Operating system: Windows 10

After a long research able to find the RCA for the same.

There is callback parameter for Grouped list onShouldVirtualize to render the full or partial HTML which is set to true by default.
Due to the length of grouped list items,entire DOM was not rendering resulting this issue.Below fixed this issue

onShouldVirtualize={() => false }

Avoid Credential Popup on Connect-SPOService

While using SharePoint online management shell, every time credential needs to be entered to connect to Tenant and is a hindrance for script execution.

There is a round about way to avoid this.

Below script can be used as a function / method inside the intended script:  (highlighted is the key line for making it feasible).

$adminUPN=”<login name for tenant / SharePoint admin.>”
$orgName=”<Name of the organization>”
$password = ConvertTo-SecureString “<Password>” -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential ($adminUPN, $password)
Connect-SPOService -Url https://$ -Credential $Cred

Caution to update modify search display template


Fix applied


  1. Download the html file ~sitecollection/_catalogs/masterpages/display templates/search/Control_SearchResults.html
  2. Under <mso:CustomDocumentProperties> tag remove the below

<mso:HtmlDesignAssociated msdt:dt=”string”>1</mso:HtmlDesignAssociated>

<mso:HtmlDesignStatusAndPreview msdt:dt=”string”> Templates/Search/Control_SearchResults.html, Conversion successful.</mso:HtmlDesignStatusAndPreview>

<mso:HtmlDesignConversionSucceeded msdt:dt=”string”>True</mso:HtmlDesignConversionSucceeded>

<mso:CrawlerXSLFile msdt:dt=”string”></mso:CrawlerXSLFile>


  1. And remove the tag

var g_duration = 102;

var g_iisLatency = 1;

var g_responseEnd = new Date().getTime();


How it was found

By downloading the fresh file from a new search center.

Get List filter data from SharePoint list

To get the filter data form SharePoint List we generally need to loop through the entire list to get the filter value.

But SharePoint online offers an application page to display the unique values for filtering the data further.

Here is the application page URL

[SharePoint Site URL] + “/_layouts/15/filter.aspx?ListId={[List GUID]}&FieldInternalName=[Internal Name of the field]&ViewId={[View GUID]}&FilterOnly=1&Filter=1



Remove Password Prompt from PDF

There are certain PDF files which requires password for every time we open the file, irrespective of the application & device.Here are 3 simple steps for to avoid it

  1. Open the PDF file in any browser like Google Chromeby entering the password.
  2. Print the file as pdf
  3. save the file to the same location.

Done !!!

Password prompt will not be popping up on every the file is opened.

Note – To perform this, at least user should have print permission for the PDF file.