diff --git a/internal/pkg/agent/install/user_windows.go b/internal/pkg/agent/install/user_windows.go index ffe545899f2..357b5c0a779 100644 --- a/internal/pkg/agent/install/user_windows.go +++ b/internal/pkg/agent/install/user_windows.go @@ -39,6 +39,8 @@ const ( USER_UF_SCRIPT = 1 USER_UF_NORMAL_ACCOUNT = 512 USER_UF_DONT_EXPIRE_PASSWD = 65536 + + accountRightCreateSymbolicLink gowin32.AccountRightName = "SeCreateSymbolicLinkPrivilege" ) // FindGID returns the group's GID on the machine. @@ -151,6 +153,10 @@ func CreateUser(name string, _ string) (string, error) { if err != nil { return "", fmt.Errorf("failed to set service logon: %w", err) } + err = sp.AddAccountRight(sid, accountRightCreateSymbolicLink) + if err != nil { + return "", fmt.Errorf("failed to add right to create symbolic link: %w", err) + } return FindUID(name) }