Goal
Restore Active Directory (AD) sign-in and team permissions on a self-hosted Octopus Server running on Windows by giving the Octopus Server service account read access to AD user and group membership. This applies when AD users cannot sign in, sign in but belong only to the Everyone team, or lose their team permissions after the Synchronize external security groups task runs. AD authentication is not available on Octopus Cloud, so this article does not apply there.
Prerequisites
- A self-hosted Octopus Server on Windows with the Active Directory authentication provider enabled.
- The Octopus Server service starts and stays running. If it does not start, fix that first; this article covers only AD lookup failures on a service that is running.
- Writable domain controllers. Octopus does not support read-only domain controllers.
- Administrator access to the Octopus Server machine, including an administrative command prompt and the ability to sign in as, or run commands as, the service account.
- Permission in Octopus to view Tasks and run Configuration > Test Permissions.
- An AD administrator who can change permissions in each domain involved.
- The names of the domains involved, whether the trust between them is one-way or two-way, and a sample user from each domain (including one who belongs to nested groups).
Steps
-
Check the username format for users in other domains.
Users in the same domain as the Octopus Server can sign in with a plain username or a UPN (user@domain.com). Users in a different (trusted) domain must enterDOMAIN\userwhen they use forms-based sign-in. If switching toDOMAIN\userfixes the sign-in, you are done. If users sign in but still see only Everyone permissions, or the problem is with the group sync task, continue. -
Find the service account Octopus uses for AD lookups.
On the Octopus Server machine, openservices.msc, double-click the Octopus Server service, and open the Log On tab. Note the account. Octopus uses this account for every AD call that retrieves a user's security groups. If the account cannot read group membership, the sign-in still succeeds but the user gets only Everyone permissions. -
Confirm the service account is in the right domain for your trust setup, and change it if not.
-
With a one-way trust where DomainA trusts DomainB, run the service as an account from DomainB. If it runs as a DomainA account, users from DomainB cannot sign in and Octopus cannot query their group information.
- With a two-way trust, run the service as an account from the same domain as the Octopus Server machine. Users in the other domain then sign in with
DOMAIN\user.
To change the account, use the Log On tab from the previous step. If the Octopus database connection string uses Windows authentication (Integrated Security=True), the new account is also the database login, so first give it the db_owner role on the Octopus database, or the service will not start. Restart the service, then confirm it reaches the Running state and stays there.
-
Test the service account's AD access outside Octopus.
Sign in to the Octopus Server machine as the service account (or use "run as" with that account) and run the two PowerShell scripts in the Verifying configuration values section of Octopus's AD troubleshooting guide. Do not run them under your own account or from your workstation, because the results will not reflect what the service sees. Set the domain name and a sample username as the guide describes. -
User group lookup script: run it for a user who is a member of nested groups. It tries
GetAuthorizationGroups()first and thenGetGroups(). If the first call throws and the second succeeds, Octopus can see only direct group memberships for that user, so nested memberships are missing. - Group search script: run it with the start of a mapped group's name. If your groups are in a trusted domain, test that domain too.
- Repeat both tests for a user from each domain you use.
Note every test that fails. A script that succeeds as a domain admin but fails as the service account confirms a permissions gap.
-
Have your AD administrator grant the service account read access.
Ask the administrator to apply whichever of these fits your environment: -
Grant the "Read member of" permission to the service account in every domain whose groups Octopus cannot read, including the service account's own domain. Domain Users do not have this permission by default. Whether you assign it directly or through a group of service accounts depends on your organization's AD standards.
-
Restore default read access if your AD was restructured. In one reported case, the missing piece was the default read permission for Authenticated Users on all objects; the fix was a security group for service accounts with read permission on the domain root, applied to the object and all descendant objects. In another, the missing piece was read permission for Authenticated Users on the Users container.
-
Repeat the AD access test as the service account.
Run the same two scripts again, as the service account, for each domain and sample user you tested before. Both scripts should now succeed, and the user group lookup script should return nested groups. If a script still fails with a domain-not-found or server-not-operational error, check DNS resolution and network connectivity from the Octopus Server machine to that domain's controllers, and check the trust itself. -
Set a custom container if the Users container is not in the default location.
Only do this if the scripts still fail because permissions block queries against the default location. Run the following from an administrative command prompt on the Octopus Server machine, replacing the example distinguished name with your own:
Octopus.Server.exe configure --activeDirectoryContainer "CN=Users,DC=example,DC=com"
The custom container guide explains how to find the right value for your directory.
Verify
- Sign in as a test user with the same method that failed (integrated sign-in, or forms-based sign-in with
DOMAIN\user). - In Octopus, run Configuration > Test Permissions for that user and confirm they appear in the teams mapped to their AD groups, not only in Everyone. Test a user in nested groups and a user from each domain.
- In Octopus, open Tasks, find a previous Synchronize external security groups run, and choose Rerun from its overflow menu (or use the API). Confirm it completes without errors and that its verbose log lists groups for your test users. Users who lost access before the fix get it back once a sync succeeds.
- Open the current Octopus Server log (see the log files guide for the location and how to change the log level) and confirm there are no new AD group lookup errors, such as
COMException (0x8007054B),ActiveDirectoryServerDownException, or "Username not found". - After the next scheduled sync, confirm users keep their team permissions.
Related
- Troubleshooting Active Directory integration: Octopus's guide to the verification scripts, AD diagnostic logging, and cross-domain group problems.
- Active Directory authentication: sign-in options, trusted domains and username formats, and the custom container setting.
- External groups and roles: how to add AD groups to teams, including groups in trusted domains.
- Specify a custom container for AD authentication: how to find and set the container value used in the custom container step.
- Log files: where Octopus Server logs are written and how to change retention and log level.
- Troubleshooting authentication problems: general sign-in issues that are not AD-specific, such as cookie or time problems.