active-directory

Find users who cannot change their password

一世执手 提交于 2021-02-19 06:32:29
问题 I am trying to prepare report of users who cannot change their password in AD. AD is installed on Window Server 2012. Here is the method, which I thought to work but isn't working - /// <summary> /// Check whether password of user cannot be changed. /// </summary> /// <param name="user">The DirectoryEntry object of user.</param> /// <returns>Return true if password cannot be changed else false.</returns> public static bool IsPasswordCannotBeChanged(DirectoryEntry user) { if (user.Properties

Azure AAD - The audience is invalid

萝らか妹 提交于 2021-02-17 19:21:12
问题 I have create a webapi secured with azure active directory. I need to test this now and trying to use fiddler with an authorization header. I am trying to generate the token with below code. Target obj = (Target)cmbTarget.SelectedItem; AuthenticationResult authenticationResult; string aadInstance = obj.AADInstance; // "https://login.windows.net/{0}"; string tenant = obj.Tenant; //"rudderless.onmicrosoft.com"; string apiResourceId = obj.ApiResourceId; //"15b4ac7f-23a8-4958-96a5-64159254690d";

Azure AAD - The audience is invalid

好久不见. 提交于 2021-02-17 19:20:10
问题 I have create a webapi secured with azure active directory. I need to test this now and trying to use fiddler with an authorization header. I am trying to generate the token with below code. Target obj = (Target)cmbTarget.SelectedItem; AuthenticationResult authenticationResult; string aadInstance = obj.AADInstance; // "https://login.windows.net/{0}"; string tenant = obj.Tenant; //"rudderless.onmicrosoft.com"; string apiResourceId = obj.ApiResourceId; //"15b4ac7f-23a8-4958-96a5-64159254690d";

Get-ADPrincipalGroupMembership Fails when any user group name has “/”

谁说我不能喝 提交于 2021-02-17 03:37:26
问题 This is really annoying and hard to find, but I've proved it in my environment so I thought I'd post it here in hopes of helping more people work around it. The problem is, when using Get-ADPrincipalGroupMembership -Identity $User.SamAccountName and one of their existing group names (that they're a member of) has a / (forward slash) in the name of any one group, it will non-terminate error on that user. So, I ran Get-ADGroup -Filter {name -like "*/*"} to see how many of these groups we have

Powershell: Get-ADComputer from another domain returns OperatingSystem information blank/missing

旧街凉风 提交于 2021-02-16 17:54:05
问题 Trying to list all computers with their OS information that belong to another trusted domain, but OperatingSystem and OperatingSystemVersion returns blank values: Get-ADComputer -Filter * -Properties Name, OperatingSystem, OperatingSystemVersion -SearchBase "" -Server OtherDomain.com.au:3268 | Format-Table Name, OperatingSystem, OperatingSystemVersion Only the Name property is populated. If I run this, it returns alot of info, but the OS info is all blank: Get-ADComputer -Filter * -Properties

Spring security Version 3.1 - Need to match user using either userPrincipalName without domain added OR sAMAccountName (search filter ?)

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-11 17:51:07
问题 All, Our IT dept has decided to change the suffix of our users in AD by adding a different suffix to the userPrincipalName in AD to the actual domain being used. e.g. our domain is xxx.com but userPrincipalName is now "usera@zzz.tech" whereas before it was "usera@xxx.com". The Spring LDAP AD authentication no longer works with this because of this reason I think: userPrincipalName is built up using name + domain when it tries to authenticate. I need to override this somehow - but keep with

Spring security Version 3.1 - Need to match user using either userPrincipalName without domain added OR sAMAccountName (search filter ?)

偶尔善良 提交于 2021-02-11 17:51:05
问题 All, Our IT dept has decided to change the suffix of our users in AD by adding a different suffix to the userPrincipalName in AD to the actual domain being used. e.g. our domain is xxx.com but userPrincipalName is now "usera@zzz.tech" whereas before it was "usera@xxx.com". The Spring LDAP AD authentication no longer works with this because of this reason I think: userPrincipalName is built up using name + domain when it tries to authenticate. I need to override this somehow - but keep with

Can't authorize token from Client Credentials Authentication Microsoft AD

我与影子孤独终老i 提交于 2021-02-11 14:56:48
问题 So I have built an Application using ASP Net Core. here is my code services.AddAuthentication(AzureADDefaults.JwtBearerAuthenticationScheme) .AddAzureADBearer(options => Configuration.Bind("AzureAd", options)); services.Configure<JwtBearerOptions>(AzureADDefaults.JwtBearerAuthenticationScheme, options => { // This is a Microsoft identity platform web API. options.Authority += "/v2.0"; // The web API accepts as audiences both the Client ID (options.Audience) and api://{ClientID}. options

Filter output (where-object) from variable

Deadly 提交于 2021-02-11 14:12:39
问题 I am running a test on servers with the following line: Get-WmiObject Win32_Service -ComputerName "myserver" -Filter "State='Running'" | where-object ??? }| Foreach-Object { New-Object -TypeName PSObject -Property @{ DisplayName=$_.DisplayName State=$_.State } | Select-Object DisplayName,State # Export all info to CSV } | ft -AutoSize I would like to create a variable like this: $IgnoreServices = '"Wireless Configuration","Telephony","Secondary Logon" and send this to Where-Object. Can I do

Is it possible to set a users memberOf property in Active Directory using Powershell

北战南征 提交于 2021-02-09 08:20:05
问题 I need to create a Powershell script that sets some user attributes in Active Directory. I'm using the Set-AdUser command and passing in a user object as follows: $user = Get-AdUser -Identity $userIdentity $user.MemberOf = $dn_of_group Set-ADUser -Instance $user this returns an error of 'The adapter cannot set the value of property "MemberOf"'. Is it possible to set the MemberOf property from powershell? If so, what am I doing wrong? 回答1: You cannot modify the MemberOf property - you need to