Click here to Skip to main content
16,006,845 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Should I use DataGrid and how to eliminate first column? Pin
Robert Rohde28-May-05 4:46
Robert Rohde28-May-05 4:46 
QuestionWhat makes a control a container? Pin
John Hind27-May-05 2:42
John Hind27-May-05 2:42 
AnswerRe: What makes a control a container? Pin
Carl Mercier27-May-05 5:37
Carl Mercier27-May-05 5:37 
GeneralRe: What makes a control a container? Pin
Anonymous27-May-05 6:47
Anonymous27-May-05 6:47 
GeneralGarbage Collection Pin
Servietsky26-May-05 19:01
Servietsky26-May-05 19:01 
GeneralRe: Garbage Collection Pin
S. Senthil Kumar26-May-05 20:30
S. Senthil Kumar26-May-05 20:30 
GeneralWebservices for database - opinion Pin
Kaushik DIA26-May-05 8:15
Kaushik DIA26-May-05 8:15 
QuestionHow to programmatically apply some policy to user/group? Pin
mmsspp25-May-05 20:13
mmsspp25-May-05 20:13 
Hi,

I want to prgrammatically apply some policy to user/group.

The related manual steps are:
Run gpedit.msc
Path is
Local Computer Policy\Cpmouter Configuration\Local Policies\User Rights Assignments\

In that "Log on Locally" policy I want to add the group \\machineName\GroupName

To achieve this I used GetAppliedGPOList API to enumarate GPOs.
This API returns SUCCESS but I dont get anything in GROUP_POLICY_OBJECT structure.

If I get GPO data in above structure, I can call some API to modify GPO data.


The code is:

// To get pSid of user call LookupAccountName API

char domain[256] = "";
DWORD domainSize = sizeof( domain );
DWORD size = 256;
PSID pSid;
pSid = (PSID) new BYTE[size];
if ( pSid == NULL)
return false;
memset(pSid, 0, size);
SID_NAME_USE eSidName;
DWORD err = LookupAccountName( NULL, "Administrator", pSid, &size, domain,
&domainSize, &eSidName );

if ( err == 0 )
err = GetLastError();
if ( IsValidSid( pSid ) == FALSE )
return false;



// With this pSid of user Call GetAppliedGPOList

GROUP_POLICY_OBJECT *pGPOList;
GUID guid =
{0x827D319E,0x6EAC,0x11D2,{0xA4,0xEA,0x00,0xC0,0x4F,0x79,0xF8,0x3A}};


DWORD error = GetAppliedGPOList( NULL, NULL,pSid,&guid, &pGPOList );


Is any other way to apply some policy to user/group?? WMI??
Please Help!!

GeneralDataAdapter and muliple tables Pin
Luke Murray25-May-05 16:54
Luke Murray25-May-05 16:54 
GeneralRe: DataAdapter and muliple tables Pin
Robert Rohde28-May-05 4:57
Robert Rohde28-May-05 4:57 
GeneralArray handling Pin
sarabjs25-May-05 9:58
sarabjs25-May-05 9:58 
GeneralRe: Array handling Pin
Scott Page25-May-05 15:26
professionalScott Page25-May-05 15:26 
GeneralRe: Array handling Pin
sarabjs26-May-05 6:04
sarabjs26-May-05 6:04 
GeneralRe: Array handling Pin
sarabjs26-May-05 11:32
sarabjs26-May-05 11:32 
GeneralRe: Array handling Pin
Scott Page27-May-05 4:06
professionalScott Page27-May-05 4:06 
GeneralRe: Array handling Pin
DavidNohejl26-May-05 12:02
DavidNohejl26-May-05 12:02 
GeneralRe: Array handling Pin
sarabjs27-May-05 8:44
sarabjs27-May-05 8:44 
GeneralRe: Array handling Pin
DavidNohejl28-May-05 6:32
DavidNohejl28-May-05 6:32 
GeneralRe: Array handling Pin
sarabjs30-May-05 7:54
sarabjs30-May-05 7:54 
GeneralRe: Array handling Pin
Robert Rohde27-May-05 5:41
Robert Rohde27-May-05 5:41 
GeneralRe: Array handling Pin
sarabjs27-May-05 9:26
sarabjs27-May-05 9:26 
GeneralRe: Array handling Pin
sarabjs27-May-05 9:48
sarabjs27-May-05 9:48 
GeneralRe: Array handling Pin
Robert Rohde28-May-05 0:40
Robert Rohde28-May-05 0:40 
GeneralRe: Array handling Pin
sarabjs30-May-05 7:44
sarabjs30-May-05 7:44 
GeneralRe: Array handling Pin
Robert Rohde30-May-05 8:31
Robert Rohde30-May-05 8:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.