Skip to content

Instantly share code, notes, and snippets.

@wrouesnel
Last active March 11, 2025 20:23
Show Gist options
  • Save wrouesnel/40244779d16b59545483ead017b018eb to your computer and use it in GitHub Desktop.
Save wrouesnel/40244779d16b59545483ead017b018eb to your computer and use it in GitHub Desktop.
automount powershell provisioning
Import-Module ActiveDirectory
# New-ADOrganizationalUnit -Name "autofs" -Path "dc=default,dc=libvirt"
# New-ADObject -Name auto.master -Path 'ou=autofs,dc=default,dc=libvirt' -Type nisMap -OtherAttributes @{'nisMapName'='auto.master'}
#New-ADObject -Name '/home' -Path 'cn=auto.master,ou=autofs,dc=default,dc=libvirt' -Type nisObject -OtherAttributes @{'nisMapName'='/home'; 'nisMapEntry'='auto.home'}
#New-ADObject -Name auto.home `
# -Path 'ou=autofs,dc=default,dc=libvirt' `
# -Type nisMap `
# -OtherAttributes @{'nisMapName'='auto.home'}
#New-ADObject -Name auto.direct -Path 'ou=autofs,dc=default,dc=libvirt' -Type nisMap -OtherAttributes @{'nisMapName'='auto.direct'}
New-ADObject -Name '*' `
-Path 'cn=auto.home,ou=autofs,dc=default,dc=libvirt' `
-Type nisObject `
-OtherAttributes @{'nisMapName'='*'; `
'nisMapEntry'='-fstype=cifs,sec=krb5,user=$USER,cruid=$UID,uid=$UID,gid=$GID,vers=3,multiuser ://server-1.default.libvirt/Users$'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment