Citrix StoreFront – Reset SF to the factory default state

How to reset your StoreFront (version 3.6 in this example) to the factory default state

Citrix KB
How to Reset StoreFront to the Initial Factory Settings
http://support.citrix.com/article/CTX200239

  1. Open PowerShell console as an administrator
  2. Go to folder:
    C:\Program Files\Citrix\Receiver StoreFront\Scripts
  3. Import required modules using this command:
     C:\Program Files\Citrix\Receiver StoreFront\Scripts>. .\ImportModules.ps1
  4. Reset SF config using this command:
     Clear-DSConfiguration

     

Citrix StoreFront – Export and import configuration

How to export and import StoreFront configuration

Citrix documentation for SF 3.6
https://docs.citrix.com/en-us/storefront/3-6/export-import-storefront-config.html

If you use Windows 2008 R2 for StoreFront, you need to upgrade PowerShell to version 3.0 or newer.
Export-STFConfiguration cmdlet does not work with PowerShell 2.0 on Windows 2008 R2 causing error:

An error occurred configuring StoreFront diagnostics. Unable to find type [PSCredential]: make sure that the assembly containing this type is loaded.

With PowerShell 3.0 it works fine.

To export/import SF configuration:

Open PowerShell as an administrator and use following commads:
1. load required modules

$SDKModules = 'C:\Program Files\Citrix\Receiver StoreFront\PowerShellSDK\Modules\Citrix.StoreFront'
Import-Module "$SDKModules\Citrix.StoreFront.psd1" -verbose
Import-Module "$SDKModules.Authentication\Citrix.StoreFront.Authentication.psd1" -verbose
Import-Module "$SDKModules.Roaming\Citrix.StoreFront.Roaming.psd1" -verbose
Import-Module "$SDKModules.Stores\Citrix.StoreFront.Stores.psd1" -verbose
Import-Module "$SDKModules.WebReceiver\Citrix.StoreFront.WebReceiver.psd1" -verbose
Import-Module "$SDKModules.SubscriptionsStore\Citrix.StoreFront.SubscriptionsStore.psd1" -verbose

2. export configuration

Export-STFConfiguration -targetFolder "c:\sfbkp\" -zipFileName "sfbackup01" -NoEncryption

3. import configuration

Import-STFConfiguration -configurationZip "c:\sfbkp\sfbackup01.zip" -HostBaseUrl http://sfront.yourdomain.net

These commands allow to export and import StoreFront configuration on a single server, or on a master SF server within of single group of StoreFront servers.
For more examples please check Citrix documentation under a link at the begining of this post.

 

Windows 2008 Manage DHCP from command line

How to get MAC addresses of VM using PowerCLI:
PowerCLI C:\> Get-VM | ? {$_.name -like "xdw7pool*"} | Get-NetworkAdapter | sele
ct mac*

How to add reservation to a scope:
netsh dhcp server \\dhcpsrv01 scope 172.16.16.0 add reservedip 172.16.16.56 005056a63c31 xdw7pool03

More on DHCP command line configuration:
http://www.techotopia.com/index.php/Managing_a_Windows_Server_2008_R2_DHCP_Server_from_the_Command_Line

DHCP custom PowerShell module for Windows 2008 R2:
http://blogs.technet.com/b/heyscriptingguy/archive/2011/02/14/use-the-powershell-dhcp-module-to-simplify-dhcp-management.aspx

DHCP module for Windows 2012:
http://blogs.technet.com/b/teamdhcp/archive/2012/07/15/bringing-powershell-to-dhcp-server.aspx