Skip to Content
Active Directory Administration Cookbook
book

Active Directory Administration Cookbook

by Sander Berkouwer
May 2019
Intermediate to advanced
620 pages
21h 41m
English
Packt Publishing
Content preview from Active Directory Administration Cookbook

How to do it...

This feature can only be leveraged using Windows PowerShell.

Normally, to add a group membership to a group, you'd use the following lines of PowerShell:

Import-Module ActiveDirectoryAdd-ADGroupMember -Identity "CN=Group,OU=Organizational Unit,DC=lucernpub,DC=com" -Members "User"

However, to create an expiring group membership to a group, use the following lines of PowerShell on a system with the Active Directory Module for Windows PowerShell installed:

Import-Module ActiveDirectoryAdd-ADGroupMember -Identity "CN=Group,OU=Organizational Unit,DC=lucernpub,DC=com" -Members "User" -MemberTimeToLive (New-TimeSpan -Days 14)  

To view the time-to-live for group memberships, use the following lines of PowerShell on a system with the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Active Directory Cookbook

Active Directory Cookbook

Robbie Allen
Active Directory Cookbook, 4th Edition

Active Directory Cookbook, 4th Edition

Brian Svidergol, Robbie Allen

Publisher Resources

ISBN: 9781789806984Supplemental Content