public void Add(string groupName, string description, string serverName = null) { var groupInfo = new LocalGroupInfo1 { GroupName = groupName, Comment = description, }; uint parameterErrorIndex; var result = NativeMethods.NetLocalGroupAdd(null, 1, ref groupInfo, out parameterErrorIndex); if (result != SystemErrorCode.ErrorSuccess) { throw ErrorHelper.GetWin32Exception(result); } }
public static extern SystemErrorCode NetLocalGroupAdd( [MarshalAs(UnmanagedType.LPWStr)]string serverName, uint level, ref LocalGroupInfo1 groupInfo, out uint parameterErrorIndex);
public static extern SystemErrorCode NetLocalGroupAdd( [MarshalAs(UnmanagedType.LPWStr)] string serverName, uint level, ref LocalGroupInfo1 groupInfo, out uint parameterErrorIndex);