Keep it Simple

// practice, the distance between dream and achievement

Tag: Powershell (page 1 of 3)

Powershell – How to find the Members of a given AD Group?

Is there a command line way to list all the users in a particular Active Directory group? Yes, we can achieve this PowerShell without having to install additional plug-ins.

$groupName = “GroupName”

$users = ((net group $groupName /domain |  Where-Object { $_ -notmatch ‘^(The request|$|Group Name|Comment|Members|–|The c)’ }) -replace ‘\s+’, ‘,’ -split “,”) | where {$_ -ne “”}

 [insert_adsense]

Powershell – Finding the W3WP worker process ID

You want to create a batch(.bat) file, when you have multiple websites running under different application pools on the same server, you may need to troubleshoot a specific worker process(w3wp).

apppool

[insert_adsense]

Powershell – SharePoint retention policy

When it comes to applying your retention schedule to your content, you have two choices. You can attach the retention schedule to the content type or you can attach it to the list. When attached to the content type, the retention schedule will be followed regardless of where the content type is created.

In this post however we will first see how to add a custom retention policy to a list using PowerShell.

Continue reading

Powershell – Sharepoint Impersonation

Recently I wanted to quickly test a piece of a code that access Web.SiteGroups in the context of a normal user, an ideal example for using PowerShell to quickly validate.

Found the following piece of the code from an Internet article and posting it here as it is.

Continue reading

Older posts

© 2018 Keep it Simple

Theme by Anders NorenUp ↑