active-directory

Executing code after user has been authenticated using Azure Active Directory

╄→гoц情女王★ 提交于 2021-02-04 21:06:15
问题 I created an ASP.NET MVC Core (1.1.0) application using VS2015. In the dialog, I selected the option to connect to Azure AD, so VS generated the boilerplate code and, as expected, the app redirects me to Microsoft's login page, where I can login with my work&school account. Now, after the user logs in, and before serving the first page (say, /home/index) I need to get some information from the user that I have stored in a database (like the display name, the contact information such as an

How to determine whether a user account is a (indirect) member of an AD group?

元气小坏坏 提交于 2021-02-04 12:25:00
问题 How to determine whether a user account is a member of an AD group, especially when then user is not a direct member of the group An example: user1 is member of group1 group1 is member of group2 result of a (fictional) function call IsUserMemberOf('user1', 'group2') should be TRUE For .NET there is a solution: static bool IsUserMemberOf(string userName, string groupName) { using (var ctx = new PrincipalContext(ContextType.Domain)) using (var groupPrincipal = GroupPrincipal.FindByIdentity(ctx,

Error in logging in authentication against Active Directory with ASP.NET Core by LDAP

老子叫甜甜 提交于 2021-01-29 21:16:15
问题 I'm implementing an ASP.NET Core project and I'm trying to authenticate the user login via LDAP to Active Directory. I'm using this link https://www.brechtbaekelandt.net/blog/post/authenticating-against-active-directory-with-aspnet-core-2-and-managing-users in order to implement the authentication against Active Directory with ASP.NET Core. What I've tried in appsettings.json is like below: { "AllowedHosts": "*", "ConnectionStrings": { "CSDDashboardContext": "Server=xxxx;Database=CSS;Trusted

How to open the “Active Directory Users and Computers” object properties dialog from c#?

谁说胖子不能爱 提交于 2021-01-29 17:28:10
问题 Is there a way to call this dialog from c#? I traced the apis, but non of the calls seems to call the dialog. Dsuiext.dll sounds very promissing, but there I foud just a LDAP browser. 回答1: This Microsoft sample provides the expected result. You pass an ADS path as parameter and it calls the property window. PropSheetHost.exe "LDAP://CN=user,DC=MyDomain,DC=MyTldDomain" It is important that it is case sensitive, so "ldap://.." doesn't work. The code is definitely not designed to get called

Connect to Local/On-premises Active Directory from PHP web application [closed]

耗尽温柔 提交于 2021-01-29 11:16:20
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 months ago . Improve this question Seeking for guidance on the subject as I'm really stuck on this, I am trying to connect to a microsoft server over a network to login into my system by providing my microsoft credentials. Now, what I want is whenever I try to hit my php application url, it will redirect me to

Which operator provides quicker output -match -contains or Where-Object for large CSV files

旧时模样 提交于 2021-01-29 10:55:28
问题 I am trying to build a logic where I have to query 4 large CSV files against 1 CSV file. Particularly finding an AD object against 4 domains and store them in variable for attribute comparison. I have tried importing all files in different variables and used below 3 different codes to get the desired output. But it takes longer time for completion than expected. CSV import: $AllMainFile = Import-csv c:\AllData.csv #Input file contains below EmployeeNumber,Name,Domain Z001,ABC,Test.com Z002

Add variable to Select-Object command in powershell and output to excel csv

懵懂的女人 提交于 2021-01-29 08:52:09
问题 I have a script that fetch user's manager info from a text file containing its respective groups and I want to put the results in an excel spreadsheet. Also, I'd like to add a custom variable to the Select-Objects command so it shows up as another column in excel with each user's respective group Here is what I have so far: $Properties = @( 'Title', 'Department', 'Manager' ) [string[]]$arrayFromFile = Get-Content -Path 'C:\sslvpn-active.txt' foreach($group in $arrayFromFile){ $searchb = "CN="

AD users don't get added to groups by powershell

耗尽温柔 提交于 2021-01-29 06:08:48
问题 I have a script for adding a user to the active directory. The user gets created (although there are some issues for which I'll create separate questions), but the user is not added to the groups, with the error that groups were not found. But I confirmed the groups are in the AD. This is the code I have now: $Orig_exec_policy = Get-ExecutionPolicy Set-ExecutionPolicy Bypass -Force <# This form was created using POSHGUI.com a free online gui designer for PowerShell .NAME Untitled #> Add-Type

List AD users who do not belong to one of several groups

浪尽此生 提交于 2021-01-29 02:18:09
问题 First up, I am not a script writer, so I apologise if this sounds like a real newbie question. I am trying to write a Powershell query to list all user accounts within a certain OU sub-tree who do not belong to at least one of 4 groups. As far as I can tell you cannot query this directly on the AD User object, so you need to iterate through the groups to get the membership, but I'm not clear on how to go about this across multiple groups. I have put together a script that can find all users,

Slow authentication to LDAP Server on initial login attempt

与世无争的帅哥 提交于 2021-01-29 02:14:53
问题 The application I setup uses an AspNetActiveDirectoryMembershipProvider to an LDAP server with Forms Authentication. The user authenticates properly, but the first time a user tries to log in a new browser window causes a delay of over one minute till it authenticates. If the user logs out of the application (but doesn't close the browser) and tries to log back in it only takes around 6-7 seconds to authenticate. I figure the second authentication is using a cached connection or socket to