active-directory-group

Add multiple users to multiple groups from one import csv

只谈情不闲聊 提交于 2019-11-28 04:36:40
问题 I have a csv with 2 columns, one column is AD group names and one is user account names. I am trying to read the csv and import the users into their corresponding group. Here is what i have to so far. It's saying both arguments(identity,member) are null, which makes no sense since the headers are correctly specified. import-module activedirectory $list = import-csv "C:\Scripts\Import Bulk Users into bulk groups\bulkgroups3.csv" Foreach($user in $list){ add-adgroupmember -identity $_.Group

Getting members of an AD domain group using Sharepoint API

▼魔方 西西 提交于 2019-11-27 13:03:01
问题 In my Sharepoint code I display a list of all defined users via: foreach (SPUser user in SPContext.Current.Web.AllUsers) { ... } The great part is, I can add a domain security group to a Sharepoint group (like Visitors) thus adding many users at once (simpler administration). But my code doesn't see those users at least not until they log-in for the first time (if they have sufficient rights). In this case I can only see the domain security group SPUser object instance with its IsDomainGroup

Listing All Active Directory Groups

纵然是瞬间 提交于 2019-11-27 11:36:58
问题 The following code lists some, but not all, Active Directory Groups. Why? I am trying to list all security groups, distribution groups, computer groups etc. Have I specified the wrong objectClass ? private static void ListGroups() { DirectoryEntry objADAM = default(DirectoryEntry); DirectoryEntry objGroupEntry = default(DirectoryEntry); DirectorySearcher objSearchADAM = default(DirectorySearcher); SearchResultCollection objSearchResults = default(SearchResultCollection); SearchResult myResult

Listing users in ad group recursively with powershell script without CmdLets

十年热恋 提交于 2019-11-27 06:44:20
问题 I'm trying to list everyone in a security group in an active directory without using CmdLets in PowerShell. The weird thing with my script is that it works if I list the entire directory but if I try and specify with an ldap query what I want to be listed it does not work. I know my ldap query is correct because I have used it in another similar vbs and it works. The commented lines are where i have tried to put in the query. $strFilter = "(&(objectCategory=person)(objectClass=user))" #

Get a list of members of a WinNT group

霸气de小男生 提交于 2019-11-27 03:10:35
问题 There are a couple of questions similar to this on stack overflow but not quite the same. I want to open, or create, a local group on a win xp computer and add members to it, domain, local and well known accounts. I also want to check whether a user is already a member so that I don't add the same account twice, and presumably get an exception. So far I started using the DirectoryEntry object with the WinNT:// provider. This is going ok but I'm stuck on how to get a list of members of a group

Adding and removing users from Active Directory groups in .NET

岁酱吖の 提交于 2019-11-26 21:54:08
I am writing the following methods to add and remove users from active directory in C#. void AddUserToGroup(string userId, string groupName); void RemoveUserFromGroup(string userId, string groupName); How best to implement these methods? Here is some code from CodeProject. I can't see where the AD server is specified in these examples though? (is it implicitly supplied by the .NET framework when using the LDAP protocol?). Are these examples worth following? public void AddToGroup(string userDn, string groupDn) { try { DirectoryEntry dirEntry = new DirectoryEntry("LDAP://" + groupDn); dirEntry

Adding and removing users from Active Directory groups in .NET

£可爱£侵袭症+ 提交于 2019-11-26 07:27:26
问题 I am writing the following methods to add and remove users from active directory in C#. void AddUserToGroup(string userId, string groupName); void RemoveUserFromGroup(string userId, string groupName); How best to implement these methods? Here is some code from CodeProject. I can\'t see where the AD server is specified in these examples though? (is it implicitly supplied by the .NET framework when using the LDAP protocol?). Are these examples worth following? public void AddToGroup(string