jrmugz 0 Newbie Poster

Greetings,

Below is some code where I am trying to connect to a sub organizational unit in the AD. I am not sure the syntax to use.

For the line

expireOU = "Need to specify the sub OU here."

what should I add there, if, say, the parent OU is called "parentOU", and the child OU is called "childOU"?

Also, the DateDiff code is from ASP, so not sure if it will be the same syntax in JSP, so if anyone has any tips on that, that would be great.

Thank you,
Jim

function DaysToExpire(strAccount)
{
	var expireOU;
	expireOU = "Need to specify the sub OU here."
	var i, objOU, objUser, whenPasswordExpires;
	objOU = GetObject(expireOU);
	objOU.Filter = Array("user");
	i = 1
	for (var i = 0; i <= 10; i++)
	{
		If objUser(i).cn = strAccount 
		{
			whenPasswordExpires = DateDiff("d",objUser(i).PasswordLastChanged, Date);
			DaysToExpire = 3 - DateDiff("d",objUser(i).PasswordLastChanged, Date);
			
		}
	}
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.