active-directory

Filter enabled AD users from CSV file

时光怂恿深爱的人放手 提交于 2020-06-28 03:56:27
问题 I have a script to import a list of users and want to check if any of these users are disabled. I did try to run the script below but it doesn't filter the users in the CSV file it filters everyone in the entire organization. any suggestions would be appreciated. displayname and SIP address in one of the headers in the CSV file if needed to use the header. Import-CSV -Path .\Piscataway-+1732.csv | ForEach-Object { Get-ADUser -Filter "Enabled -eq '$true'" | select Enabled,EmailAddress

Azure Active Directory SSO with Laravel

六眼飞鱼酱① 提交于 2020-06-23 08:33:09
问题 I'm doing sso with azure active directory. I have done the setup on azure and go the keys. I'm using metrogistics/laravel-azure-ad-oauth (https://packagist.org/packages/metrogistics/laravel-azure-ad-oauth) package on laravel to do this. However, when I hit the url http://localhost:8000/login/microsoft , I got redirected to microsoft login page and given an error message. I have added following configurations to env file and did whatever package has demanded. AZURE_AD_CLIENT_ID

Why PrincipalSearcher gives System.__ComObject for attribut msExchRecipientDisplayType?

99封情书 提交于 2020-06-17 15:56:19
问题 Why PrincipalSearcher gives System.__ComObject for attribut msExchRecipientDisplayType ?? I want to retrieve attribute msExchRecipientDisplayType and PrincipalSearcher gives System.__ComObject . Also I tried to retrieve it by DirectorySearcher and it gives correct value i.e. ''. 0 UserMailbox (shared) 1 MailUniversalDistributionGroup 6 MailContact 7 UserMailbox (room) 8 UserMailbox (equipment) 1073741824 UserMailbox 1073741833 MailUniversalSecurityGroup as mentioned here https://answers

The RefreshCache method not returning the complete list of tokenGroups

北城以北 提交于 2020-06-17 14:19:07
问题 I have created 2400 security groups and made a user member of all these security groups. Now I am trying to fetch all the security groups the user is member of using the DirectoryEntry.RefreshCache method. The method returns only 2050 groups. $searcher = New-Object System.DirectoryServices.DirectorySearcher($null) $searcher.SearchRoot = [ADSI]("LDAP://" + $gcName) $searcher.Filter = "((msOnline-WindowsLiveNetId=XXXXXXXX))" $searcher.PropertiesToLoad.AddRange(@("msOnline-UserPrincipalName"))

Powershell to get AD user disabled in the past 6 months?

僤鯓⒐⒋嵵緔 提交于 2020-06-17 09:59:26
问题 How to get the AD user that was disabled in the past 6 months and also the time stamp when it was disabled in dd/MM/yyyy format as.CSV file? Like using this Powershell https://docs.microsoft.com/en-us/powershell/module/addsadministration/get-aduser?view=win10-ps ? $paramhash=@{ UsersOnly = $True AccountDisabled = $True SearchBase = "OU=Employees,DC=globomantics,dc=local" } Search-ADAccount @paramHash | Get-ADuser -Properties Description,Department,Title,LastLogonDate,WhenChanged | sort

Get current logged in user IIS returning DefaultAppPool

我是研究僧i 提交于 2020-06-17 02:59:17
问题 I have an asp.net application on my server that uses WindowsAuthentication to log in. The scenario is simple: users logged in, will use the same credentials to login the application. Certainly, on IISExpress on my machine works great, but when I try to login the application on server, the current user returned is DefaultAppPool . I guess it's a missing impersonate config on IIS. I tried to get the current user with: string username = HttpContext.Current.Request.LogonUserIdentity.Name; string

Automate Connect-AzureAD using powershell in Azure Devops

别说谁变了你拦得住时间么 提交于 2020-06-11 09:06:33
问题 I am unable to automate Connect-AzureAD powershell command. In order to get user objectID, I need to automate the operation Connect-AzureAD and for that i used this code: Connect-AzureAD -TenantId $tenantId -Verbose $userObjectID = $(Get-AzureADUser -Filter "UserPrincipalName eq '$Owner'").ObjectId The operation stuck at the Connect-AzureAD. how to resolve this? 回答1: I found the solution and test it. I'm running this task in an Azure Devops pipeline; this tasks is called "Azure PowerShell

Asp.Net Core Windows Authentication Not Working in IIS

南笙酒味 提交于 2020-06-10 12:47:47
问题 Asp.Net Core doesn't seem to recognize the user from the call context?.User?.Identity?.Name when windows authentication is enabled and running in IIS Express or IIS. Desired behavior: Enabling both Windows authentication and anonymous authentication in IIS and/or IIS Express, Asp.Net Core should automatically recognize the windows user. Actual behavior: When I enable both windows and anonymous authentication in IIS or IIS Express, the user name is null. When I disable anonymous authentication

System.UnauthorizedAccessException calling UserPrincipal.SetPassword

扶醉桌前 提交于 2020-06-10 05:55:12
问题 when I run this code PrincipalContext ctx = new PrincipalContext(ContextType.Domain, adHost, adRoot, ContextOptions.SimpleBind, adUsername, adPassword); UserPrincipal user = UserPrincipal.FindByIdentity(ctx, IdentityType.SamAccountName, username); user.SetPassword(password); user.Save(); I get this exception System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.UnauthorizedAccessException: One or more input parameters are invalid

Node.Js - Getting windows username

五迷三道 提交于 2020-06-09 12:02:07
问题 I am trying to get the windows username of the machine that is running my node.jS app (the app is always running on a Windows machine). How can I get the current windows username using Node.Js? I am trying to find something similar to WindowsIdentity.GetCurrent().Name in C# for node.js, or whoamI command in CMD. 回答1: Since Node v6 (2016-04), you can just use os.userInfo : var os = require('os'); os.userInfo().username To get the current logged-in username: var path = require('path'); var