Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Active Directory if joined on non-cross account #397

Open
wants to merge 2 commits into
base: mainline
Choose a base branch
from

Conversation

icarusmiles
Copy link

@icarusmiles icarusmiles commented Aug 3, 2021

OwnerDirectoryDescription does not seem to exist in the query results.... running on Centos 7.9

aws ds describe-directories --region us-east-1 --query "DirectoryDescriptions[?DirectoryId =='d-90676a899f'].OwnerDirectoryDescription.DirectoryId | [0]" | sed 's/"//g'

Results in: null (incorrect)

--

aws ds describe-directories --region us-east-1 --query "DirectoryDescriptions[?DirectoryId =='d-90676a899f'].DirectoryId | [0]" | sed 's/"//g'

Results in: d-* (correct)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

`OwnerDirectoryDescription` does not seem to exist on Centos 7.9

```aws ds describe-directories --region us-east-1 --query "DirectoryDescriptions[?DirectoryId =='d-90676a899f'].OwnerDirectoryDescription.DirectoryId | [0]" | sed 's/"//g'```

Results in: null (incorrect)

```aws ds describe-directories --region us-east-1 --query "DirectoryDescriptions[?DirectoryId =='d-90676a899f'].DirectoryId | [0]" | sed 's/"//g'```

Results in: d-* (correct)
@icarusmiles
Copy link
Author

It appears this happens because the script assumes the Active Directory is shared.

@icarusmiles
Copy link
Author

Added some logic, maybe messy and could use a touchup. Will look for root directory ID first, then override if share exists.

@icarusmiles icarusmiles changed the title Update domainjoin_unix_script.go Support Active Directory if joined on non-cross account Aug 3, 2021
Copy link
Contributor

@smhmhmd smhmhmd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OwnerDirectoryDescription does not seem to exist on Centos 7.9

OwnerDirectoryDescription does exist, it shows only when Directories are shared.

@danVSS
Copy link

danVSS commented Jun 14, 2024

OwnerDirectoryDescription does not seem to exist on Centos 7.9

OwnerDirectoryDescription does exist, it shows only when Directories are shared.

@smhmhmd It only exists if shared. So what about when the directory isn't shared? The docs don't indicate that this will only work on shared directories. This script is broken if the directory is not shared. If OwnerDirectoryDescription doesn't exist then why not just take DirectoryId if it exists?

@smhmhmd
Copy link
Contributor

smhmhmd commented Jun 15, 2024

Thanks, I will help @VishnuKarthikRavindran check this and take the contribution in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants