Home All Groups Group Topic Archive Search About

Can I retrieve Unix box OS info using DirectoryEntry Property OS?

Author
27 Oct 2006 3:53 PM
Pucca
Hi, Using the following code, will it work for the Unix box that's on the
network's domain?  Thanks.


                                    switch (child.Parent.Name)
                                    {
                                        case "CN=Computers"://Computer
                                            if (!createLVHeader)
                                            {
                                                CreateComputerListView();
                                                createLVHeader = true;
                                            }
                                            if
(child.Properties["operatingSystem"].Value != null)
                                                os =
child.Properties["operatingSystem"].Value.ToString();
                                            else
                                                os = "";
                                            if
(child.Properties["operatingSystemVersion"].Value != null)
                                                osVersion =
child.Properties["operatingSystemVersion"].Value.ToString();
                                            else
                                                osVersion = "";
                                            //if
(child.Properties["description"].Value.ToString() != null)
                                                newLvNode = 
NodeDetail.Items.Add
                                                    (new ListViewItem(new
string[] { commonName, os, osVersion},2));
                                            //else
                                            //   
NodeDetail.Items.Add("Name", commonName, 2);
                                            //newLvNode.Tag =
(object)(child.Properties["cn"]);
                                                newLvNode.Tag =
(object)(child.Properties["cn"].Value.ToString());
                                                newLvNode.Name = objSid;
                                                globalChild.Dispose();

                                            break;
--
Thanks.

Author
27 Oct 2006 4:09 PM
Joe Kaplan
I'd check and make sure that the computer objects in the domain that
correspond to these machines actually have that data in them using an LDAP
query tool first, but if they do, it should work fine.

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
Show quoteHide quote
"Pucca" <Pu***@discussions.microsoft.com> wrote in message
news:CEB2FCB3-91EE-4C4B-A5AB-0B5AD7D5F358@microsoft.com...
> Hi, Using the following code, will it work for the Unix box that's on the
> network's domain?  Thanks.
>
>
>                                    switch (child.Parent.Name)
>                                    {
>                                        case "CN=Computers"://Computer
>                                            if (!createLVHeader)
>                                            {
>                                                CreateComputerListView();
>                                                createLVHeader = true;
>                                            }
>                                            if
> (child.Properties["operatingSystem"].Value != null)
>                                                os =
> child.Properties["operatingSystem"].Value.ToString();
>                                            else
>                                                os = "";
>                                            if
> (child.Properties["operatingSystemVersion"].Value != null)
>                                                osVersion =
> child.Properties["operatingSystemVersion"].Value.ToString();
>                                            else
>                                                osVersion = "";
>                                            //if
> (child.Properties["description"].Value.ToString() != null)
>                                                newLvNode =
> NodeDetail.Items.Add
>                                                    (new ListViewItem(new
> string[] { commonName, os, osVersion},2));
>                                            //else
>                                            //
> NodeDetail.Items.Add("Name", commonName, 2);
>                                            //newLvNode.Tag =
> (object)(child.Properties["cn"]);
>                                                newLvNode.Tag =
> (object)(child.Properties["cn"].Value.ToString());
>                                                newLvNode.Name = objSid;
>                                                globalChild.Dispose();
>
>                                            break;
> --
> Thanks.
Are all your drivers up to date? click for free checkup

Author
27 Oct 2006 4:45 PM
Pucca
Tool like ldp.exe?
--
Thanks.


Show quoteHide quote
"Joe Kaplan" wrote:

> I'd check and make sure that the computer objects in the domain that
> correspond to these machines actually have that data in them using an LDAP
> query tool first, but if they do, it should work fine.
>
> Joe K.
>
> --
> Joe Kaplan-MS MVP Directory Services Programming
> Co-author of "The .NET Developer's Guide to Directory Services Programming"
> http://www.directoryprogramming.net
> --
> "Pucca" <Pu***@discussions.microsoft.com> wrote in message
> news:CEB2FCB3-91EE-4C4B-A5AB-0B5AD7D5F358@microsoft.com...
> > Hi, Using the following code, will it work for the Unix box that's on the
> > network's domain?  Thanks.
> >
> >
> >                                    switch (child.Parent.Name)
> >                                    {
> >                                        case "CN=Computers"://Computer
> >                                            if (!createLVHeader)
> >                                            {
> >                                                CreateComputerListView();
> >                                                createLVHeader = true;
> >                                            }
> >                                            if
> > (child.Properties["operatingSystem"].Value != null)
> >                                                os =
> > child.Properties["operatingSystem"].Value.ToString();
> >                                            else
> >                                                os = "";
> >                                            if
> > (child.Properties["operatingSystemVersion"].Value != null)
> >                                                osVersion =
> > child.Properties["operatingSystemVersion"].Value.ToString();
> >                                            else
> >                                                osVersion = "";
> >                                            //if
> > (child.Properties["description"].Value.ToString() != null)
> >                                                newLvNode =
> > NodeDetail.Items.Add
> >                                                    (new ListViewItem(new
> > string[] { commonName, os, osVersion},2));
> >                                            //else
> >                                            //
> > NodeDetail.Items.Add("Name", commonName, 2);
> >                                            //newLvNode.Tag =
> > (object)(child.Properties["cn"]);
> >                                                newLvNode.Tag =
> > (object)(child.Properties["cn"].Value.ToString());
> >                                                newLvNode.Name = objSid;
> >                                                globalChild.Dispose();
> >
> >                                            break;
> > --
> > Thanks.
>
>
>
Author
27 Oct 2006 4:46 PM
Joe Kaplan
That's what I use, but any LDAP query tool you like will work fine.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
Show quoteHide quote
"Pucca" <Pu***@discussions.microsoft.com> wrote in message
news:9B37BAD1-21FB-4D00-BB83-7E905A5E035D@microsoft.com...
> Tool like ldp.exe?
> --
> Thanks.
>
>
> "Joe Kaplan" wrote:
>
>> I'd check and make sure that the computer objects in the domain that
>> correspond to these machines actually have that data in them using an
>> LDAP
>> query tool first, but if they do, it should work fine.
>>
>> Joe K.
>>
>> --
>> Joe Kaplan-MS MVP Directory Services Programming
>> Co-author of "The .NET Developer's Guide to Directory Services
>> Programming"
>> http://www.directoryprogramming.net
>> --
>> "Pucca" <Pu***@discussions.microsoft.com> wrote in message
>> news:CEB2FCB3-91EE-4C4B-A5AB-0B5AD7D5F358@microsoft.com...
>> > Hi, Using the following code, will it work for the Unix box that's on
>> > the
>> > network's domain?  Thanks.
>> >
>> >
>> >                                    switch (child.Parent.Name)
>> >                                    {
>> >                                        case "CN=Computers"://Computer
>> >                                            if (!createLVHeader)
>> >                                            {
>> >
>> > CreateComputerListView();
>> >                                                createLVHeader = true;
>> >                                            }
>> >                                            if
>> > (child.Properties["operatingSystem"].Value != null)
>> >                                                os =
>> > child.Properties["operatingSystem"].Value.ToString();
>> >                                            else
>> >                                                os = "";
>> >                                            if
>> > (child.Properties["operatingSystemVersion"].Value != null)
>> >                                                osVersion =
>> > child.Properties["operatingSystemVersion"].Value.ToString();
>> >                                            else
>> >                                                osVersion = "";
>> >                                            //if
>> > (child.Properties["description"].Value.ToString() != null)
>> >                                                newLvNode =
>> > NodeDetail.Items.Add
>> >                                                    (new
>> > ListViewItem(new
>> > string[] { commonName, os, osVersion},2));
>> >                                            //else
>> >                                            //
>> > NodeDetail.Items.Add("Name", commonName, 2);
>> >                                            //newLvNode.Tag =
>> > (object)(child.Properties["cn"]);
>> >                                                newLvNode.Tag =
>> > (object)(child.Properties["cn"].Value.ToString());
>> >                                                newLvNode.Name = objSid;
>> >                                                globalChild.Dispose();
>> >
>> >                                            break;
>> > --
>> > Thanks.
>>
>>
>>
Author
27 Oct 2006 6:12 PM
Pucca
Thank you very much.
--
Thanks.


Show quoteHide quote
"Joe Kaplan" wrote:

> That's what I use, but any LDAP query tool you like will work fine.
>
> --
> Joe Kaplan-MS MVP Directory Services Programming
> Co-author of "The .NET Developer's Guide to Directory Services Programming"
> http://www.directoryprogramming.net
> --
> "Pucca" <Pu***@discussions.microsoft.com> wrote in message
> news:9B37BAD1-21FB-4D00-BB83-7E905A5E035D@microsoft.com...
> > Tool like ldp.exe?
> > --
> > Thanks.
> >
> >
> > "Joe Kaplan" wrote:
> >
> >> I'd check and make sure that the computer objects in the domain that
> >> correspond to these machines actually have that data in them using an
> >> LDAP
> >> query tool first, but if they do, it should work fine.
> >>
> >> Joe K.
> >>
> >> --
> >> Joe Kaplan-MS MVP Directory Services Programming
> >> Co-author of "The .NET Developer's Guide to Directory Services
> >> Programming"
> >> http://www.directoryprogramming.net
> >> --
> >> "Pucca" <Pu***@discussions.microsoft.com> wrote in message
> >> news:CEB2FCB3-91EE-4C4B-A5AB-0B5AD7D5F358@microsoft.com...
> >> > Hi, Using the following code, will it work for the Unix box that's on
> >> > the
> >> > network's domain?  Thanks.
> >> >
> >> >
> >> >                                    switch (child.Parent.Name)
> >> >                                    {
> >> >                                        case "CN=Computers"://Computer
> >> >                                            if (!createLVHeader)
> >> >                                            {
> >> >
> >> > CreateComputerListView();
> >> >                                                createLVHeader = true;
> >> >                                            }
> >> >                                            if
> >> > (child.Properties["operatingSystem"].Value != null)
> >> >                                                os =
> >> > child.Properties["operatingSystem"].Value.ToString();
> >> >                                            else
> >> >                                                os = "";
> >> >                                            if
> >> > (child.Properties["operatingSystemVersion"].Value != null)
> >> >                                                osVersion =
> >> > child.Properties["operatingSystemVersion"].Value.ToString();
> >> >                                            else
> >> >                                                osVersion = "";
> >> >                                            //if
> >> > (child.Properties["description"].Value.ToString() != null)
> >> >                                                newLvNode =
> >> > NodeDetail.Items.Add
> >> >                                                    (new
> >> > ListViewItem(new
> >> > string[] { commonName, os, osVersion},2));
> >> >                                            //else
> >> >                                            //
> >> > NodeDetail.Items.Add("Name", commonName, 2);
> >> >                                            //newLvNode.Tag =
> >> > (object)(child.Properties["cn"]);
> >> >                                                newLvNode.Tag =
> >> > (object)(child.Properties["cn"].Value.ToString());
> >> >                                                newLvNode.Name = objSid;
> >> >                                                globalChild.Dispose();
> >> >
> >> >                                            break;
> >> > --
> >> > Thanks.
> >>
> >>
> >>
>
>
>

Bookmark and Share