libb.mount_admin_share

mount_admin_share(host, password, unmount=False)[source]

Mount or unmount the admin$ share required for psexec commands.

Resolves host to IP address to avoid Windows multiple-connection errors.

Parameters:
  • host (str) – Remote host name.

  • password (str) – Password for authentication.

  • unmount (bool) – If True, unmount instead of mount.

Note

Connects by IP address to work around Windows complaining about multiple connections to a share by the same user.