[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.axapta.programming

Re: get table instance from Tablename

Micha³ Kupczyk

10/11/2005 10:49:00 AM

From: "Cordoba"
>>I've already looked at Dicttable-Class but I didn't found any solution.

Look again, there is. :-)

makeRecord()

Michal


2 Answers

rosevilleca

7/17/2008 5:58:00 PM

0

On Jul 17, 10:23 am, rosevill...@gmail.com wrote:
> On Jul 17, 8:14 am, "Richard Mueller [MVP]" <rlmueller-
>
>
>
>
>
> nos...@ameritech.nospam.net> wrote:
> > <rosevill...@gmail.com> wrote in message
>
> >news:8bf239dc-d474-4fb2-885c-f06f589602b8@i76g2000hsf.googlegroups.com...
>
> > >I made a simple batch file to get a list of machines belonging to
> > > certain groups, save it to a file then open it in Excel.
>
> > > See below:
>
> > >dsgetgroup"cn=AdobeAcrobat9,ou=*,ou=Groups,ou=*,DC=*,DC=*" -members -
> > > expand | sort > "c:\documents and settings\%username%\desktop
> > > \spreadsheetname.xls
> > > start excel.exe "c:\documents and settings\%username%\desktop
> > > \spreadsheetname.xls
>
> > > It works but the output is ugly with it displaying a bunch of info
> > > about the path that to the OU that I don't need to look at, and, at
> > > the same time, there is a bit more info I want that I can't get it to
> > > display.
>
> > > It has the followingproblems.
>
> > > 1.  Excel fails to seperate the OU info into seperate cells despite
> > > the info being seperated by commas. (I'd like to solve this comma
> > > seperation or just not show this info).
>
> > > 2.  I need to get the "description" field of the computers, but when I
> > > try to add "desc" todsgetit gives the description field of the
> > > AdobeAcrobat9groupinstead the description field of each of the
> > > members of thegroup.
>
> > > 3.  I really don't need it to display all the OU info.  All I'd like
> > > it do is save a list of the machine names that belong to the
> > > AdobeAcrobat9groupin a format Excel can display elegantly and in
> > > alphabetical order.  The description field of each of the member
> > > computers should be displayed in the same row as the computer name.
>
> > > How can this be done?
> > > Can it be done with a simple bat file or does it have to be a vbs
> > > script?
>
> > It may be possible to do this with dsquery anddsget, but I tried for some
> > time and failed. Some of my attempts failed if any members of thegroupwere
> > users (objects of class other than computer). A bigger problem might be that
> > these commands are only available on W2k3 DC's (and above). I would use a
> > VBScript program similar to:
> > ==========
> > Option Explicit
> > Dim objGroup, objMember, strName
> > Dim strExcelPath, objExcel, objSheet, intRow
>
> > ' Spreadsheet file to be created.
> > strExcelPath = "c:\scripts\Computers.xls"
>
> > ' Bind to Excel object.
> > Set objExcel = CreateObject("Excel.Application")
>
> > ' Create a new workbook.
> > objExcel.Workbooks.Add
>
> > ' Bind to worksheet.
> > Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
>
> > ' Bind to thegroupobject.
> > Set objGroup =
> > GetObject("LDAP://cn=AdobeAcrobat9,ou=*,ou=Groups,ou=*,DC=*,DC=*")
>
> > ' Enumerate direct members.
> > intRow = 1
> > For Each objMember In objGroup.Members
> >     If (objMember.Class = "computer") Then
> >         ' Retrieve NetBIOS name of computer.
> >         strName = objMember.sAMAccountName
> >         ' Strip off trailing "$"
> >         strName = Left(strName, Len(strName) - 1)
> >         objSheet.Cells(intRow, 1).Value = strName
> >         objSheet.Cells(intRow, 2).Value = objMember.description
> >         intRow = intRow + 1
> >     End If
> > Next
>
> > objExcel.ActiveWorkbook.SaveAs strExcelPath
> > objExcel.ActiveWorkbook.Close
> > ========- Hide quoted text -
>
> > - Show quoted text -
>
> I saved it as a vbs file, tried it and it fails with a message:
> "Variable is undefined: 'objMember'- Hide quoted text -
>
> - Show quoted text -

Nevermind, I figured out how to declare the variables and it works.
It runs successfully and saves the info to a file.
However, it doesn't work using the %username% path to the desktop or
automatically launch the file my original batch file though.
How can I have launch automatically so the user doesn't have to go
hunt for the file and click on it?

Kuma

7/19/2008 12:36:00 PM

0

On Jul 18, 2:58 am, rosevill...@gmail.com wrote:
> On Jul 17, 10:23 am, rosevill...@gmail.com wrote:
>
>
>
>
>
> > On Jul 17, 8:14 am, "Richard Mueller [MVP]" <rlmueller-
>
> > nos...@ameritech.nospam.net> wrote:
> > > <rosevill...@gmail.com> wrote in message
>
> > >news:8bf239dc-d474-4fb2-885c-f06f589602b8@i76g2000hsf.googlegroups.com....
>
> > > >I made a simple batch file to get a list of machines belonging to
> > > > certain groups, save it to a file then open it in Excel.
>
> > > > See below:
>
> > > >dsgetgroup"cn=AdobeAcrobat9,ou=*,ou=Groups,ou=*,DC=*,DC=*" -members -
> > > > expand | sort > "c:\documents and settings\%username%\desktop
> > > > \spreadsheetname.xls
> > > > start excel.exe "c:\documents and settings\%username%\desktop
> > > > \spreadsheetname.xls
>
> > > > It works but the output is ugly with it displaying a bunch of info
> > > > about the path that to the OU that I don't need to look at, and, at
> > > > the same time, there is a bit more info I want that I can't get it to
> > > > display.
>
> > > > It has the followingproblems.
>
> > > > 1.  Excel fails to seperate the OU info into seperate cells despite
> > > > the info being seperated by commas. (I'd like to solve this comma
> > > > seperation or just not show this info).
>
> > > > 2.  I need to get the "description" field of the computers, but when I
> > > > try to add "desc" todsgetit gives the description field of the
> > > > AdobeAcrobat9groupinstead the description field of each of the
> > > > members of thegroup.
>
> > > > 3.  I really don't need it to display all the OU info.  All I'd like
> > > > it do is save a list of the machine names that belong to the
> > > > AdobeAcrobat9groupin a format Excel can display elegantly and in
> > > > alphabetical order.  The description field of each of the member
> > > > computers should be displayed in the same row as the computer name.
>
> > > > How can this be done?
> > > > Can it be done with a simple bat file or does it have to be a vbs
> > > > script?
>
> > > It may be possible to do this with dsquery anddsget, but I tried for some
> > > time and failed. Some of my attempts failed if any members of thegroupwere
> > > users (objects of class other than computer). A bigger problem might be that
> > > these commands are only available on W2k3 DC's (and above). I would use a
> > > VBScript program similar to:
> > > ==========
> > > Option Explicit
> > > Dim objGroup, objMember, strName
> > > Dim strExcelPath, objExcel, objSheet, intRow
>
> > > ' Spreadsheet file to be created.
> > > strExcelPath = "c:\scripts\Computers.xls"
>
> > > ' Bind to Excel object.
> > > Set objExcel = CreateObject("Excel.Application")
>
> > > ' Create a new workbook.
> > > objExcel.Workbooks.Add
>
> > > ' Bind to worksheet.
> > > Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
>
> > > ' Bind to thegroupobject.
> > > Set objGroup =
> > > GetObject("LDAP://cn=AdobeAcrobat9,ou=*,ou=Groups,ou=*,DC=*,DC=*")
>
> > > ' Enumerate direct members.
> > > intRow = 1
> > > For Each objMember In objGroup.Members
> > >     If (objMember.Class = "computer") Then
> > >         ' Retrieve NetBIOS name of computer.
> > >         strName = objMember.sAMAccountName
> > >         ' Strip off trailing "$"
> > >         strName = Left(strName, Len(strName) - 1)
> > >         objSheet.Cells(intRow, 1).Value = strName
> > >         objSheet.Cells(intRow, 2).Value = objMember.description
> > >         intRow = intRow + 1
> > >     End If
> > > Next
>
> > > objExcel.ActiveWorkbook.SaveAs strExcelPath
> > > objExcel.ActiveWorkbook.Close
> > > ========- Hide quoted text -
>
> > > - Show quoted text -
>
> > I saved it as a vbs file, tried it and it fails with a message:
> > "Variable is undefined: 'objMember'- Hide quoted text -
>
> > - Show quoted text -
>
> Nevermind, I figured out how to declare the variables and it works.
> It runs successfully and saves the info to a file.
> However, it doesn't work using the %username% path to the desktop or
> automatically launch the file my original batch file though.
> How can I have launch automatically so the user doesn't have to go
> hunt for the file and click on it?- Hide quoted text -
>
> - Show quoted text -

Powershell can run on 2k3 XP 2k8 and Vista, it just doesn't come
installed by default. The quest active directory cmdlets are free to
download and can make working with AD much simpler. Each computer that
you would want to make the report on would need to have it installed
though.