Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group Policy Deployment

Status
Not open for further replies.

aparikh80

Technical User
Apr 20, 2006
37
US
I am trying to deploy great plains 9.0 via group policy. Apprantly the configuration is done in the EXE not the MSI any way to deploy a exe file.

Also is thier a way to create ODBC via gp.
 
You can create odbc connections via gp by using a login script that executes a .reg file.

For instance. The following .reg file will create an odbc named mm_prod on both the user and system dsn tabs.

REGEDIT4

[HKEY_CURRENT_USER\Software\ODBC]
[HKEY_CURRENT_USER\Software\ODBC\ODBC.INI]
[HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources]
"mm_prod"="SQL Server"

[HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\mm_prod]
"Driver"="C:\\WINDOWS\\SYSTEM\\sqlsrv32.dll"
"Description"="mm_prod"
"Server"="SERVERNAMEHERE"
"UseProcForPrepare"="No"
"Database"="mm_prod"
"OEMTOANSI"="No"
"LastUser"="sa"
"Language"=""

[HKEY_LOCAL_MACHINE\Software\ODBC]
[HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI]
[HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI\ODBC Data Sources]
"mm_prod"="SQL Server"


[HKEY_LOCAL_MACHINE\Software\ODBC\ODBC.INI\mm_prod]
"Driver"="C:\\WINDOWS\\SYSTEM\\sqlsrv32.dll"
"Description"="mm_prod"
"Server"="SERVERNAMEHERE"
"UseProcForPrepare"="No"
"Database"="mm_prod"
"OEMTOANSI"="No"
"LastUser"="sa"
"Language"=""

[HKEY_USERS\.Default\Software\ODBC]
[HKEY_USERS\.Default\Software\ODBC\ODBC.INI]
[HKEY_USERS\.Default\Software\ODBC\ODBC.INI\ODBC Data Sources]
"mm_prod"="SQL Server"


[HKEY_USERS\.Default\Software\ODBC\ODBC.INI\mm_prod]
"Driver"="C:\\WINDOWS\\SYSTEM\\sqlsrv32.dll"
"Description"="mm_prod"
"Server"="SERVERNAMEHERE"
"UseProcForPrepare"="No"
"Database"="mm_prod"
"OEMTOANSI"="No"
"LastUser"="sa"
"Language"=""

I would advise manually creating the required odbc for great plains, then exporting it and using that as the .reg file you execute via the login script.

Hope this helps.

MH
 
Using a Reg file is OK, but it won't set a passowrd ont eh ODBC connection if you want or need one. The followign script I wrote some time ago for a customer will create an ODBC connection and set its password as well. In this example the application is called AppEnabler and the password is Temp1.

Code:
'==========================================================================
'
' NAME: AppEnablerCreateODBC.vbs
'
' AUTHOR: Mark D. MacLachlan, The Spider's Parlor
' URL:  http;//[URL unfurl="true"]www.thespidersparlor.com[/URL]
' DATE  : 11/3/2005
'
' COMMENT: Script will check to see if it has been run on computer previously
'			If it has, it will not run.  Script adds desktop icon For
'			App Enabler on Desktop and Startup folder.  Also sets ODBC settings
'			so App Enabler can work.  Also copies file to link with Active
'			Directory.  Adds Registry key HKLM\Software\MYCOMPANY\Installs\AppEnabler\1
'==========================================================================

Set WshShell = WScript.CreateObject("WScript.Shell")
On Error Resume Next
regpath = "HKLM\SOFTWARE\MYCOMPANY\Installs\"
NautInstall = (WSHShell.Regread(regpath & "AppEnabler"))
 If NautInstall = "1" Then
 	WScript.Quit
 Else
   Dim DataSourceName
   Dim DatabaseName
   Dim dbDescription
   Dim DriverPath
   Dim DriverName
   Dim LastUser
   Dim Regional
   Dim Server

   Const SystemFolder= 1
   Dim fso
   Dim SysFolder
   Dim SysFolderPath

   Set fso = wscript.CreateObject("Scripting.FileSystemObject")
   Set SysFolder =fso.GetSpecialFolder(SystemFolder)
   SysFolderPath= SysFolder.Path

   'Specify the DSN parameters.

   DataSourceName = "Temp1"
   DatabaseName = "Temp1"
   dbDescription = ""
   DriverPath = SysFolderPath & "\sqlsrv32.dll"
   Server = "Temp2"
   LastUser  = "DBUser"

   DriverName = "SQL Server"
   
   Dim RegEdPath
   RegEdPath= "HKLM\SOFTWARE\ODBC\ODBC.INI\" & DataSourceName & "\"
   
   WshShell.RegWrite  RegEdPath  , ""

   

   WshShell.RegWrite  RegEdPath & "Database" , DatabaseName
   WshShell.RegWrite  RegEdPath & "Description" , dbDescription
   WshShell.RegWrite  RegEdPath & "Driver" , DriverPath
   WshShell.RegWrite  RegEdPath & "LastUser" , LastUser
   WshShell.RegWrite  RegEdPath & "Server" , Server

   WshShell.RegWrite "HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources\" & DataSourceName , DriverName

WshShell.Run("odbcad32.exe")
WshShell.AppActivate "Microsoft ODBC Administrator"
WScript.Sleep 10
WshShell.Sendkeys "+{tab}"
WshShell.AppActivate "Microsoft ODBC Administrator"
WshShell.Sendkeys "{right}"
WshShell.AppActivate "Microsoft ODBC Administrator"
WshShell.Sendkeys "{tab}"
WshShell.AppActivate "Microsoft ODBC Administrator"
WshShell.Sendkeys "Temp1"
WshShell.AppActivate "Microsoft ODBC Administrator"
WshShell.Sendkeys "%c"
WshShell.AppActivate "Microsoft ODBC Administrator"
WshShell.Sendkeys "%n"
WshShell.AppActivate "Microsoft ODBC Administrator"
WshShell.Sendkeys "%p"
WshShell.AppActivate "Microsoft ODBC Administrator"
WshShell.Sendkeys "DBPassword"
WshShell.AppActivate "Microsoft ODBC Administrator"
WshShell.Sendkeys "%n"
WshShell.AppActivate "Microsoft ODBC Administrator"
WshShell.Sendkeys "%n"
WshShell.AppActivate "Microsoft ODBC Administrator"
WshShell.Sendkeys "{enter}"
WshShell.AppActivate "Microsoft ODBC Administrator"
WshShell.Sendkeys "{right}"
WshShell.AppActivate "Microsoft ODBC Administrator"
WshShell.Sendkeys "{enter}"
WshShell.AppActivate "Microsoft ODBC Administrator"
WshShell.Sendkeys "{enter}"

Call WSHShell.Run("cmd.exe /C copy \\bedrock\shared\DMLogin.htm C:\Progra~\Hyland\Desktop\Forms\ /y")

strFavs = WshShell.SpecialFolders("AllUsersDesktop") 
strshortcut = strFavs & "\App Enabler.lnk" 
If Not fso.FileExists(strshortcut) Then 
        SET oUrlLink = WshShell.CreateShortcut(strshortcut) 
        exePath = "C:\Program Files\Hyland\Application Enabler\AEClient.exe"
        oUrlLink.TargetPath = exePath
        oUrlLink.Arguments = Chr(34) & "\\bedrock\imagesoft$\AppEnabler.xml" & Chr(34)
        oUrlLink.WorkingDirectory = ""
        oUrlLink.Save 
End If 


strFavs = WshShell.SpecialFolders("AllUsersStartup") 
strshortcut = strFavs & "\App Enabler.lnk" 
If Not fso.FileExists(strshortcut) Then 
        SET oUrlLink = WshShell.CreateShortcut(strshortcut) 
        exePath = "C:\Program Files\Hyland\Application Enabler\AEClient.exe"
        oUrlLink.TargetPath = exePath
        oUrlLink.Arguments = Chr(34) & "\\bedrock\imagesoft$\AppEnabler.xml" & Chr(34)
        oUrlLink.WorkingDirectory = ""
        oUrlLink.Save 
End If 

WSHShell.RegWrite regpath & "AppEnabler","1","REG_DWORD"
End If

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
By default, Group Policy Software Distribution only allows for MSI/MST installations, or NonMSI setups via ZAP, however ZAP installations are somewhat limited in mangeability. However, there is a product by Specsoft which allows for simple deployment of EXEs, among many other features. SpecOps Deploy
However, it isn't free and its client specific pricing for the licence. There is a fully functional 20-day trial download here. SpecOps Deploy 20-day Trial

The FREE ZAP way is a little more tricky.....

You need to create what is called a ZAP file. The biggest guide to this can be found in the Group Policy Guide from Microsoft Press. If you want. I have, for some daft reason, typed out the whole Software Distribution chapter when I was learning about it, if you want to read about the ZAPs, I can post what I typed...If I can find it, and hoping that it would not be breaking copywriting laws.

There is step by steps to creating ZAP files for EXE programs here.
Installing Non MSI Applications with Group Policy

Hope this Helps.

Neil J Cotton
njc Information Systems
Systems Consultant
 
I have used SpecOP and was very disappointed. As a matter of fact, I tested it for the AppEnabler product. Funny coincidence huh?

I thought this solution was fairly cool myself Neil. One of those times when you pat yourself on the back and feel good about finding a creative solution to a problem. I wish Microsoft would add scripting support for setting a password via ODBC and just not allow script to read that value.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
The ZAP installations are easy to set up...just fiddley, make sure you follow the steps carefuly, if you do, you shouldn't have any problems.

Hope this Helps.

Neil J Cotton
njc Information Systems
Systems Consultant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top