Home > Forum > Actions > [solved] Active Directory Contact

[solved] Active Directory Contact
0

Hello,
is it possible to create an Active Directory “contact” (not user) with an action or in any other way.

Although I haven't personally tried it, you might consider using a PowerShell script to create a new object in Active Directory.

Microsoft Copilot suggested the following code:
--BEGIN --

# Define the parameters for the new contact
$contactName = "John Doe"
$displayName = "John Doe"
$path = "OU=Contacts,DC=example,DC=com"
$mail = "john.doe@example.com"

# Define user credentials
$credential = New-Object System.Management.Automation.PSCredential($username, $password)

# Create the new contact
New-ADObject -Name $contactName -Type contact -Path $path -OtherAttributes @{'displayName'=$displayName; 'mail'=$mail} -Credential $credential

Write-Host "Contact $contactName created successfully."

-- END --

Please note that $username and $password should be defined in the action configuration (see attached screenshot).

I haven't tested this code myself, but I wanted to share the idea of using a PowerShell script.

Best.

Did you know that with WEBCON you can automate virtually any process? Even baking cookies 🍪
 
Speaking of cookies: we use the ones that are essential for our website to function properly, as well as additional ones that help us customize our content to your preferences. If you don’t mind cookies, click Accept. If you want to learn more, explore settings.
Settings