Badgerati / Pode

Pode is a Cross-Platform PowerShell web framework for creating REST APIs, Web Sites, and TCP/SMTP servers
https://badgerati.github.io/Pode
MIT License
826 stars 92 forks source link

Error in "Add-PodeAuthWindowsAd" command on MAC #1354

Open Ankit-Sharma-ggn opened 1 month ago

Ankit-Sharma-ggn commented 1 month ago

Describe the Bug

Error in "Add-PodeAuthWindowsAd" command on MAC. When I check the Authentication.ps1 having functions related to authentication. line number - 2111 $dn = (dnsdomainname) is not wokring on MAC.

Error

. '/Users/Ankit_Sharma-GGN/projects/Studies/PowerShell/web/server.ps1' Pode v2.10.1 (PID: 1124) dnsdomainname: /Users/Ankit_Sharma-GGN/.local/share/powershell/Modules/Pode/2.10.1/Private/Authentication.ps1:2111:16 Line | 2111 | $dn = (dnsdomainname) | ~~~~~ | The term 'dnsdomainname' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is | correct and try again.

Platform

Badgerati commented 1 month ago

I've transferred the issue over to Pode, as this bug is within Pode itself.

@Ankit-Sharma-ggn, does the following work instead?

/usr/sbin/realm list --name-only

If not, do you happen to know what the equivalent of the above and dnsdomainname is on MacOS?

Ankit-Sharma-ggn commented 1 month ago

this worked for me

scutil --dns | grep -m 1 "search domain\[0\]" | cut -d ":" -f 2