Pages

Sunday, 8 July 2012

AppV 5.0 Beta Server Installation - Requirements



Following are the requirements to install AppV 5 Beta Server


  • Microsoft Windows .NET Framework 4 Extended Version
  • Windows Web Server 2008 with only the following features: Common HTTP Features (static content and default document), Application Development (ASP.NET, .NET Extensibility, ISAPI Extensions and ISAPI Filters), Security (Windows Authentication, Request Filtering)
  • Microsoft .NET Framework 3.5 (For PowerShell support.)
  • Download and install KB253623.( Its a printing mistake in guide, hence the actual KB is KB2533623)
  • The Microsoft Visual C++ 2008 Redistributable Package (x64)(http://www.microsoft.com/download/en/details.aspx?id=15336)
  • You must install both versions of the Microsoft .NET Framework (Microsoft .NET 3.5 and Microsoft .NET 4). Microsoft .NET 3.5 is required with Microsoft .NET 4 to enable and support the App-V 5.0 Beta Server PowerShell cmdlets.


Note: Installing the App-V 5.0 Beta server is not supported for the following scenarios:


  • Installing on a domain controller.
  • Installing on a server running previous versions of App-V server components.
  • Installing on Server Core.


Friday, 6 July 2012

Append Entry in Hosts file - VBScript



Following script will append the entry present in sample.txt file to hosts file. 


Following script needs sample.txt and hosts file to be present in the same directory where script file is locatied. Please change TargetFile and Input paths according to requirement.


************************************************************

Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim TargetFile,objWshShell,objFSO, Input, ProgramFiles, WinDir
Dim objTextFile, Target


Set objWshShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")


ProgramFiles = ObjWshShell.ExpandEnvironmentStrings("%ProgramFiles%")
WinDir = ObjWshShell.ExpandEnvironmentStrings("%WinDir%")


CDir = objFSO.GetParentFolderName(Wscript.ScriptFullName)


Set Targetfile = objFSO.GetFile(CDir & "\hosts")
Set Input = objFSO.GetFile(CDir & "\Sample.txt")


Set objTextFile = objFSO.OpenTextFile (Input, ForReading)
Set Target = CreateObject("Scripting.FileSystemObject")
Set TargetFile = Target.OpenTextFile (TargetFile, ForAppending, True)


Do Until objTextFile.AtEndOfStream
Input = objTextFile.ReadLine
TargetFile.WriteLine(Input)
Loop


TargetFile.Close
ObjTextFile.Close


***************************************************************


-> Create sample.txt file with following content for example and save it in same location where vbscript file is present.

                  #     10.10.10.10    www.sample.com


-> Place hosts file in the same location where VBscript is present.
-> Run the VBscript, above line will be appended to hosts file.





Running powershell scripts on Windows



Why do you get weird error messages when you try to run a script? That’s easy. The security settings built into Windows PowerShell include something called the “execution policy;” the execution policy determines how (or if) PowerShell runs scripts. By default, PowerShell’s execution policy is set to Restricted; that means that scripts - including those you write yourself - won’t run. Period.

Note. You can verify the settings for your execution policy by typing the following at the PowerShell command prompt and then pressing ENTER:

Get-ExecutionPolicy
suppose you want to configure PowerShell to run - without question - any scripts that you write yourself, but to run scripts downloaded from the Internet only if those scripts have been signed by a trusted publisher. In that case, use this command to set your execution policy to RemoteSigned:
Set-ExecutionPolicy RemoteSigned
Alternatively, you can set the execution policy to AllSigned (all scripts, including those you write yourself, must be signed by a trusted publisher) or Unrestricted (all scripts will run, regardless of where they come from     and whether or not they’ve been signed).

Regardless of your location within the file system. It doesn’t matter if you’re in C:\Scripts; you still need to type the following:
C:\Scripts\Sample.ps1

Convert Legacy AppV Package to AppV 5.0 format



Following Powershell command should be used to convert AppV packages developed using AppV 4.6SP1 or less TO AppV 5.0 format.


ConvertFrom-LegacyAppvPackage -source "{legacy pkgs}" -target "{vnext pkgs}"


where {legacy pkgs} and {v.Next pkgs} represent the path to the associated packages.



Sftmime and App-V 5.0 BetaPowerShell cmdlets


The following table displays the sftmime functions available with previous versions of App-V 5.0 Beta and the App-V 5.0 Beta PowerShell equivalent:




To install the App-V 5.0 BetaPowerShell Cmdlets




1. To use the Server App-V PowerShell Cmdlets open an elevated PowerShell cmd prompt and import the modules by running one of the following commands:


2. To load the Server App-V client cmdlets, type:
           PS C:\> Import-Module AppVClient
    To load the Server App-V server cmdlets, type:
           PS C:\> Import-Module AppVServer
    To load the Server App-V sequencer cmdlets, type:
           PS C:\> Import-Module AppVSequencer
    To load the Server App-V package converter cmdlets, type:
           PS C:\> Import-Module AppVConverter




AppV 5.0 Client GUI



AppV Client Interface in version 5.0 has changed to resemble Windows 8 tiles




Available AppV packages are visible as displayed below, we can find if its a offline package or streamed and also has the option to reset/repair user state.




The location where AppV package content is stored is C:\ProgramData\AppV\[PackageID]