|
|
|
 | |
|  |
 |
|
If [Not] ComputerExists <ComputerName> Then | Tests if specified Active Directory computer exists. If domain is different than the domain of the executing user, specify ComputerName as <Domain>\<ComputerName>.
Example: If ComputerExists AcmePC0010 Then |
|
If [Not] ComputerIsInDomain Then If [Not] ComputerIsInDomain <ComputerName> Then | Tests if the computer is member of a domain. If no computername has been specified, the executing computer is assumed.
Example: If ComputerIsInDomain Then |
|
|  |
 |
|
If [Not] ComputerIsMemberOf <GroupName> Then If [Not] ComputerIsMemberOf <GroupName>, <ComputerName> Then | Tests if the computer is member of the Active Directory group or any nested sub group. A nested group is for instance when a computer is member of 'Sales Florida Computers' and 'Sales Florida Computers' is a member of 'Sales America Computers', then the computer is also implicitly a member of 'Sales America Computers' and the condition is true for both. If no computer is specified, the executing computer is assumed. If domain is different than the current users' domain, specifying as <Domain>\<GroupName> and <Domain>\<ComputerName>.
Example: If ComputerIsMemberOf Acme Sales Computers Then ConnectShare J:,\\AcmeServer\SalesShare |
|
If [Not] GroupExists <GroupName> Then | Tests if specified Active Directory group exists. If domain is different than the domain of the executing user, specify group as <Domain>\<GroupName>.
Example: If GroupExists AcmeGroup Then |
|
If [Not] GroupIsMemberOf <GroupName>, <GroupName> Then | Tests if the first Active Directory group is member of the second Active Directory group or any nested sub group. If domain is different than the current users' domain, specifying domain group as <Domain>\<GroupName>.
Example: If GroupIsMemberOf Acme Sales Florida Users,Acme Sales Users Then |
|
If [Not] UserIsMemberOf <DomainGroupName> Then If [Not] UserIsMemberOf <DomainGroupName>, <UserName> Then | Tests if the user is a member of the specified Active Directory group directly or through nested groups. A nested group is for instance when a user is member of 'Sales Florida Users' and 'Sales Florida Users' is a member of 'Sales America Users', then the user is also implicitly a member of 'Sales America Users' and the condition is true for both. If no user is specified, the currently logged on user is assumed. If domain is different than the current users' domain, specify user as <Domain>\<UserName>.
Example: If UserIsMemberOf SalesStaff Then ConnectShare J:,\\AcmeServer\SalesShare |
|
|  |
 |
|
If [Not] ComputerIsInOU <OU Name> Then If [Not] ComputerIsInOU <OU Name>, <ComputerName> Then | Tests if the computer is in the Organizational Unit in the Active Directory or any Organizational Unit below. If computername is not specified, the executing computer is assumed. Domain is by default the domain of the logged on user, to specify another domain, use <Domain>\<ComputerName>.
Example: If ComputerIsInOU ShopComputers Then ConnectShare J:,\\AcmeServer\ShopShare |
|
If [Not] GroupIsInOU <GroupName>, <OUName> Then | | Tests if the group is in the Organizational Unit in the Active Directory or any Organizational Unit below. Domain is by default the domain of the logged on user, to specify another domain, use <Domain>\<GroupName>. |
|
If [Not] OUExists <OUName> Then | Tests if specified Active Directory organizational unit exists. Domain is by default the domain of the logged on user, to specify another domain, use <Domain>\<OUName>.
Example: If Not OUExists Acme Sales America Then CreateOU Acme Sales America,Acme Sales Gloal |
|
If [Not] UserIsInOU <OU Name> Then If [Not] UserIsInOU <OU Name>, <UserName> Then | Tests if the user is a in the Organizational Unit from the Active Directory or any Organizational Unit below. If not username is specified, current user is assumed. Domain is by default the domain of the logged on user, to specify another domain, use <Domain>\<UserName>.
Example: If UserIsInOU SalesStaff Then ConnectShare J:,\\AcmeServer\SalesShare |
|
|  |
 |
|
If [Not] UserCanChangePassword Then If [Not] UserCanChangePassword <UserName> Then | Tests if specified Active Directory user can change password. Domain is by default the domain of the logged on user, to specify another domain, use <Domain>\<UserName>.
Example: If UserCanChangePassword Then |
|
If [Not] UserEnabled <UserName> Then | Tests if specified Active Directory user account is enabled. Domain is by default the domain of the logged on user, to specify another domain, use <Domain>\<UserName>.
Example: If UserEnabled AcmeUser Then |
|
If [Not] UserExists <UserName> Then | Tests if specified Active Directory user account exists. Domain is by default the domain of the logged on user, to specify another domain, use <Domain>\<UserName>.
Example: If UserExists AcmeUser Then |
|
If [Not] UserHasPasswordExpiry Then If [Not] UserHasPasswordExpiry <UserName> Then | Tests if specified Active Directory user's password can expire. Domain is by default the domain of the logged on user, to specify another domain, use <Domain>\<UserName>.
Example: If UserHasPasswordExpiry Then |
|
If [Not] UserIsAdmin Then | Tests if current user is a domain administrator, use UserIsLocalAdmin to test for local administrator.
Example: If UserIsAdmin Then |
|
If [Not] UserIsInDomain Then | Tests if the current user is a domain user.
Example: If UserIsInDomain Then |
|
If [Not] UserIsLocalAdmin Then If [Not] UserIsLocalAdmin <UserName> Then | Tests if current user is local administrator, use UserIsAdmin to test for domain administrator. If no user is specified, the currently logged on user is assumed. If domain is different than the current users' domain, specify user as <Domain>\<UserName>.
Example: If UserIsLocalAdmin Then |
|
If [Not] UserMustChangePassword Then If [Not] UserMustChangePassword <UserName> Then | Tests if specified Active Directory user is forced to change password at next logon. Domain is by default the domain of the logged on user, to specify another domain, use <Domain>\<UserName>.
Example: If UserMustChangePassword Then |
|
If [Not] UserProfileIsRoaming Then If [Not] UserProfileIsRoaming <UserName> Then | Tests if the users is roaming it's profile. If no username is specified, current user is assumed. Domain is by default the domain of the logged on user, to specify another domain, use <Domain>\<UserName>.
Example: If UserProfileIsRoaming Then |
|
|  |
 |
|
If [Not] DirectoryExists <FileName> Then | Tests if specified directory exists.
Example: If Not DirectoryExists [UserDocumentsDir]\AcmeFiles Then MakeDir [UserDocumentsDir]\AcmeFiles |
|
|  |
 |
|
If [Not] ProcessRunning <ProcessName> Then | Tests if the specified process is running.
Example: If ProcessRunning Acme.Exe Then KillProcess Acme.Exe |
|
|  |
 |
|
If [Not] FileExists <FileName> Then | Tests if specified file exists.
Example: If FileExists [UserHomeDir]\DocumentsBackup.zip Then UnZip [UserHomeDir]\DocumentsBackup.zip,[UserDocumentsDir]\Restore |
|
|  |
 |
|
If [Not] Ask <Message> Then If [Not] Ask <Message>, <HeaderText> Then | Asks for message and enters the loop is answer is positive. You can use [Return] function to make the message appear in multiple lines.
Example: If Ask "Do you want to empty your recycle bin?" Then EmptyRecycleBin |
|
|  |
 |
|
If [Not] Installed <ApplicationName> Then | Tests if the specified FastTrack scriptet application is installed.
Example: If Installed Microsoft Office Then WriteRegistry HKCU\Software\Microsoft\Office\Common\UserInfo\Company,Acme Corp |
|
If [Not] InstalledBuild <ApplicationName>, <Build> Then | Tests if the specified application is installed in the specific build.
Example: If InstalledBuild Microsoft Office,3 Then WriteRegistry HKCU\Software\Microsoft\Office\Common\UserInfo\Company,Acme Corp |
|
If [Not] InstalledVersion <ApplicationName>, <Version> Then | Tests if the specified application is installed in the specific version.
Example: If InstalledVersion Microsoft Office,2007 Then WriteRegistry HKCU\Software\Microsoft\Office\Common\UserInfo\Company,Acme Corp |
|
If [Not] ProgramInstalled <ApplicationName> Then | Tests if the specified program is installed in the Windows programs list. You can specify the-most left part, meaning your can use "Microsoft Office" instead of the full name to check for any version.
Example: If ProgramInstalled Microsoft Office Then |
|
If [Not] UserSettingsOnce <ApplicationName> Then | Only true once per user on a machine that has a registered installation (RegisterInstallation command). Used to set the user settings part for installations.
Example: If UserSettingsOnce Microsoft Office Then Include Settings\OfficeSettings.fsh |
|
If [Not] UserSettingsOnceABuild <ApplicationName> Then | True once every time the build number installed (RegisterInstallation command) is different than the build number when user settings was applied last time or user settings has never been applied. Always false if the application is not installed.
Example: If UserSettingsOnceABuild Microsoft Office Then Include Settings\OfficeSettings.fsh |
|
If [Not] UserSettingsOnceAVersion <ApplicationName> Then | True once every time the version number installed (RegisterInstallation command) is different than the version number when user settings was applied last time or user settings has never been applied. Always false if the application is not installed.
Example: If UserSettingsOnceAVersion Microsoft Office Then Include Settings\OfficeSettings.fsh |
|
If [Not] UserSettingsProgramOnce <ApplicationName> Then | | Same as UserSettingsOnce, except it is for a program listed in Add/Remove Programs. You can use the left part only. |
|
|  |
 |
|
If [Not] Once <GlobalIDKey> Then | True only once for the local machine; requires admin privileges, use UserOnce for user intervals. You have to provide a globally unique id key that is not used in any other script. The engine stores this key in the registry to determine if it has ever been triggered or not.
Example: If Once InitialMachineModding Then Include SetupScripts\InitialSetup.fsh |
|
If [Not] OnceADay Then | True only once a day for the machine, which is useful for cleanups; requires admin privileges, use UserOnceADay for user intervals.
Example: If OnceADay Then Include DailyCleanup.fsh |
|
If [Not] OnceAMonth Then | True only once a month for the machine, which is useful for cleanups; requires admin privileges, use UserOnceAMonth for user intervals.
Example: If OnceAMonth Then Include MonthlyCleanup.fsh |
|
If [Not] OnceAWeek Then | True only once a week for the machine, which is useful for cleanups; requires admin privileges, use UserOnceAWeek for user intervals.
Example: If OnceAWeek Then Include WeeklyCleanup.fsh |
|
If [Not] UserOnce <GlobalIDKey> Then | True only once per user. You have to provide a globally unique id key that is not used in any other script. The engine stores this key in the registry to determine if it has ever been triggered or not.
Example: If UserOnce ShowWelcome Then ShowWebPage http://intra.acme.com/Welcome,Welcome to Acme |
|
If [Not] UserOnceADay Then | True only once a day for the current user.
Example: If UserOnceADay Then Include DailyCleanup.fsh |
|
If [Not] UserOnceAMonth Then | True only once a month for the current user.
Example: If OnceAMonth Then Include MonthlyCleanup.fsh |
|
If [Not] UserOnceAWeek Then | True only once a week for the current user.
Example: If UserOnceAWeek Then Include WeeklyCleanup.fsh |
|
|  |
 |
|
If [Not] GroupIsLocalMemberOf <DomainGroupName>, <LocalGroupName> Then If [Not] GroupIsLocalMemberOf <DomainGroupName>, <LocalGroupName>, <RemoteComputerName> Then | Tests if the domain group is a member of the local group. If domain is different than the current users' domain, specify group as <Domain>\<GlobalGroupName>.
Example: If GroupIsLocalMemberOf [DomainAdminsGroup],Administrators Then |
|
If [Not] LocalGroupExists <GroupName> Then If [Not] LocalGroupExists <GroupName>, <RemoteComputerName> Then | Tests if specified local group exists.
Example: If LocalGroupExists AcmeGroup Then |
|
If [Not] LocalUserIsLocalMemberOf <GroupName> Then If [Not] LocalUserIsLocalMemberOf <GroupName>, <UserName> Then If [Not] LocalUserIsLocalMemberOf <GroupName>, <UserName>, <RemoteComputerName> Then | Tests if the local user is a member of the local group. If no username is specified, logged on local user is assumed.
Example: If LocalUserIsLocalMemberOf AcmeUser,Administrators Then |
|
If [Not] UserIsLocalMemberOf <GroupName> Then If [Not] UserIsLocalMemberOf <GroupName>, <UserName> Then If [Not] UserIsLocalMemberOf <GroupName>, <UserName>, <RemoteComputerName> Then | Tests if the Active Directory user is a member of the local group directly or through nested domain groups inside the local group. A nested membership is for instance when a user is member of Domain Admins and Domain Admins is a member of the local Administrators group, then the user is implicitly a member of Administrators and the conditions is true. If no user is specified, the currently logged on user is assumed. If domain is different than the current users' domain, specify user as <Domain>\<UserName>.
Example: If UserIsLocalMemberOf Administrators Then |
|
|  |
 |
|
If [Not] LocalUserCanChangePassword Then If [Not] LocalUserCanChangePassword <UserName> Then If [Not] LocalUserCanChangePassword <UserName>, <RemoteComputerName> Then | Tests if specified local user can change password. If no user is specified, locally logged on user is assumed.
Example: If LocalUserCanChangePassword Then |
|
If [Not] LocalUserEnabled <UserName> Then If [Not] LocalUserEnabled <UserName>, <RemoteComputerName> Then | Tests if specified local user account is enabled.
Example: If LocalUserEnabled AcmeUser Then |
|
If [Not] LocalUserExists <UserName> Then If [Not] LocalUserExists <UserName>, <RemoteComputerName> Then | Tests if specified local user account exists.
Example: If LocalUserExists AcmeUser Then |
|
If [Not] LocalUserHasPasswordExpiry Then If [Not] LocalUserHasPasswordExpiry <UserName> Then If [Not] LocalUserHasPasswordExpiry <UserName>, <RemoteComputerName> Then | Tests if specified local user's password can expire. If no user is specified, locally logged on user is assumed.
Example: If LocalUserHasPasswordExpiry Then |
|
If [Not] LocalUserIsLocalAdmin Then If [Not] LocalUserIsLocalAdmin <UserName> Then | Tests if the local user is local administrator. If no user is specified, locally logged on user is assumed.
Example: If LocalUserIsLocalAdmin Then |
|
If [Not] LocalUserMustChangePassword Then If [Not] LocalUserMustChangePassword <UserName> Then If [Not] LocalUserMustChangePassword <UserName>, <RemoteComputerName> Then | Tests if specified local user is forced to change password at next logon. If no user is specified, locally logged on user is assumed.
Example: If LocalUserMustChangePassword Then |
|
|  |
 |
|
If [Not] Alive <RemoteComputerName> Then | Tests if the specified machine or ip is reachable by sending a ping request. The targeting machine has 1000 ms to respond to the ping request.
Example: If Alive AcmeProxy Then SetProxyServer AcmeProxy,8080 |
|
If [Not] InIpScope <StartIP>, <EndIP Then | Tests if the computer's primary network IP address is between the start IP address and the end IP address, both inclusive.
Example: If InIpScope 192.168.0.0,192.168.255.255 Then DisableProxyServer |
|
|  |
 |
|
If [Not] RegistryKeyExists <RegistryKey> Then | Tests if the specified registry key exists. HKey_Local_Machine, HKey_Current_User and HKey_Classes_Root can be abbreviated to HKLM, HKCU and HKCR.
Example: If RegistryKeyExists HKCU\Software\Acme Then |
|
If [Not] RegistryKeyExistsx86 <RegistryKey> Then | Tests if the specified registry key exists. HKey_Local_Machine, HKey_Current_User and HKey_Classes_Root can be abbreviated to HKLM, HKCU and HKCR. Key is checked in the redirected registry for 32-bit applications on a 64-bit operating system. Works the same as RegistryKeyExists on a 32-bit operating system or non-redirected keys.
Example: If RegistryKeyExistsx86 HKCU\Software\Acme Then |
|
If [Not] RegistryValueExists <RegistryKey>, <RegistryValue> Then | Tests if the specified registry value exists. To test the content of the value, use the RegistryValue function instead, for instance "If Not [RegistryValue HKCU\Control Panel\Desktop\WallPaper]=[WinDir]\Acme.png Then".
HKey_Local_Machine, HKey_Current_User and HKey_Classes_Root can be abbreviated to HKLM, HKCU and HKCR.
Example: If RegistryValueExists HKCU\Software\Acme\Setup Then |
|
If [Not] RegistryValueExistsx86 <RegistryKey>, <RegistryValue> Then | Tests if the specified registry value exists. To test the content of the value, use the RegistryValuex86 function instead, for instance "If Not [RegistryValuex86 HKCU\Control Panel\Desktop\WallPaper]=[WinDir]\Acme.png Then".
Value is checked in the redirected registry for 32-bit applications on a 64-bit operating system. Works the same as RegistryValueExists on a 32-bit operating system or non-redirected keys.
HKey_Local_Machine, HKey_Current_User and HKey_Classes_Root can be abbreviated to HKLM, HKCU and HKCR.
Example: If RegistryValueExistsx86 HKCU\Software\Acme\Setup Then |
|
|  |
 |
|
If [Not] ServiceInstalled <ServiceName> Then | Tests if the service is installed. Both ServiceName and DisplayName can be used.
Example: If ServiceInstalled MSSQL$SQLEXPRESS Then |
|
If [Not] ServiceRunning <ServiceName> Then | Tests if the service is in a running state. Both ServiceName and DisplayName can be used.
Example: If ServiceRunning MSSQL$SQLEXPRESS Then |
|
|  |
 |
|
If [Not] ShareExists <UNCPath> Then | Tests if specified file exists.
Example: If ShareExists \\[ComputerName]\WinShared$ Then SetSharePermissions \\[ComputerName]\WinShared$,Acme\Domain Users:Read,Acme\Domain Admins:Full Control |
|
|  |
 |
|
If [Not] Desktop Then | Tests if the computer is a desktop (assumed if there are no batteries).
Example: If Not Desktop Then SyncDir [UserDocumentsDir],[UserHomeDir]\DocumentsBackup |
|
If [Not] NetworkPresent Then | | Tests if a network is present. |
|
If [Not] Portable Then | Tests if the computer is a portable (assumed if there is a battery).
Example: If Portable Then SyncDir [UserDocumentsDir],[UserHomeDir]\DocumentsBackup |
|
If [Not] RunningOnBatteries Then | Tests if the computer is running on batteries (not plugged into A/C).
Example: If Not RunningOnBatteries Then RunScript \\AcmeServer\Installers$\Office2007\Install.fsh,Acme\Installer,<EncryptedPassword> |
|
If [Not] Server Then | True if operating system is a server version of Windows. Can be used for instance to stop a logon script execution on a server.
Example: If Server Then Exit |
|
If [Not] Windows2000 Then | | True if operating system is Windows 2000. |
|
If [Not] Windows2003 Then | | True if operating system is Windows 2003 Server (can be both R1 and R2). |
|
If [Not] Windows2008 Then | | True if operating system is Windows 2008 Server (can be both R1 and R2). |
|
If [Not] Windows32Bit Then | | True if operating system is a 32 bit version of Windows. |
|
If [Not] Windows64Bit Then | | True if operating system is a 64 bit version of Windows. |
|
If [Not] Windows7 Then | | True if operating system is Windows 7. |
|
If [Not] WindowsNT4 Then | | True if operating system is Windows NT 4. |
|
If [Not] WindowsVista Then | | True if operating system is Windows Vista. |
|
If [Not] WindowsXP Then | | True if operating system is Windows XP. |
|
If [Not] Workstation Then | | True if operating system is a workstation version of Windows. |
|
|  |
 |
|
If [Not] TerminalServer Then | Tests if the session is on terminal server. Useful for stopping logon script execution on terminal services.
Example: If TerminalServer Then Exit |
|
|  |
|
|
|