App-V - SCCM OS Restriction
Hi! Has anyone figured out how to restrict an App-V Package to "run on a specified client platform"? We are trying to test virtual apps in out production environment, but when I add one to a collection, all my XP boxes can see the advertisement.
With MSI Packages, you had "programs" which you could restrict, but with App-V packages, there is no option.
anybody run into this?
thanks
With MSI Packages, you had "programs" which you could restrict, but with App-V packages, there is no option.
anybody run into this?
thanks
0 Comments
[ + ] Show comments
Answers (8)
Please log in to answer
Posted by:
jriekse5555
12 years ago
Posted by:
StephenCWLL
14 years ago
Posted by:
briggsm
14 years ago
Posted by:
anonymous_9363
14 years ago
I have used the SCCM script interface (whose methods etc. are mostly still prefixed with 'SMS'...) to create groups and collections, as part of a script which adds packages to SCCM. Provided your groups, collections, packages etc. use a standardised naming convention, that would be the route I'd suggest.
Posted by:
kkaminsk
14 years ago
Posted by:
briggsm
14 years ago
Posted by:
anonymous_9363
14 years ago
Code samples for SCCM interaction are few and far between. Microsoft's snippets are next to useless, as they're presented "out of context". It took me many hours of reading and playing about with parameters to end up with my deployment script. Consequently, I'm loath to post it willy-nilly (especially having seen other code of mine appearing bastarised [and non-functional!] all over the place in the past). However, here's some code from that script which will hopefully steer you in the right direction.
blnMainResult = Connect(strComputer,strUserName,strPassword, objSCCMConnection)
blnMainResult = CreateGroup(strGroup)
blnMainResult = CreateCollection(objSCCMConnection, strNewCollectionName, strNewCollectionComment, strNewParentCollectionName, strGroup, strNewCollectionID)
Function CreateGroup(ByVal strGroup)
'// Create new group
CreateGroup = False
On Error Resume Next
Set objOU = GetObject("LDAP://" & strOU & ", " & strDomain)
strMsg = ""
strMsg = strMsg & "Create OU object"
Call CheckError(strMsg, strMsg, "", True, False, blnErrorIsFatal)
If blnErrorIsFatal Then
Exit Function
End If
Set objGroup = objOU.Create("Group","CN=" & strGroup)
strMsg = ""
strMsg = strMsg & "Create Group object"
Call CheckError(strMsg, strMsg, "", True, False, blnErrorIsFatal)
If blnErrorIsFatal Then
Exit Function
End If
With objGroup
.Put "sAMAccountName", strGroup
strMsg = ""
strMsg = strMsg & "Put method on sAMAccountOU"
Call CheckError(strMsg, strMsg, "", True, False, blnErrorIsFatal)
If blnErrorIsFatal Then
Exit Function
End If
'// Here is where you set the group Type and Scope
.Put "groupType", ADS_GROUP_TYPE_GLOBAL_GROUP Or ADS_GROUP_TYPE_SECURITY_ENABLED
strMsg = ""
strMsg = strMsg & "Put method on groupType"
Call CheckError(strMsg, strMsg, "", True, False, blnErrorIsFatal)
If blnErrorIsFatal Then
Exit Function
End If
.setInfo
strMsg = ""
strMsg = strMsg & "SetInfo method on objGroup"
Call CheckError(strMsg, strMsg, -2147019886, True, False, blnErrorIsFatal)
If blnErrorIsFatal Then
Exit Function
End If
End With
On Error Goto 0
CreateGroup = True
Set objGroup = Nothing
Set objOU = Nothing
End Function
Function CreateCollection(ByVal objConn, ByVal strCollectionName, ByVal strCollectionComment, ByVal strParentCollectionName, ByVal strResourceName, ByRef strCollectionIDPassBack)
Dim colCollections
Dim objCollection
Dim blnCollectionExists
Dim objCollectionRelation
Dim objCollectionRule
Dim strCollectionPath
Dim strCollectionID
Dim strExistingCollectionName
Dim strParentCollectionID
Dim objResource
Dim colResources
Dim strResourceID
Dim strResourceUserGroupName
On Error Resume Next
CreateCollection = False
'// Determine whether the specified Collection name is unique
Set colCollections = objConn.ExecQuery("Select * From SMS_Collection")
strMsg = ""
strMsg = strMsg & "Check for unique Collection name"
Call CheckError(strMsg, strMsg, "", True, False, blnErrorIsFatal)
If blnErrorIsFatal Then
Exit Function
End If
blnCollectionExists = False
For Each objCollection In colCollections
strExistingCollectionName = objCollection.Name
'// While we're here, we may as well get the parent collection's ID
'// We know its name so...
If UCase(strExistingCollectionName ) = UCase(strParentCollectionName) Then
strParentCollectionID = objCollection.CollectionID
End If
If Not blnCollectionExists Then
If strExistingCollectionName = strCollectionName Then
strMsg = ""
strMsg = strMsg & "Collection name is already in use"
'Err.Raise 1, "CreateCollection", strMsg
Call CheckError(strMsg, strMsg, "", True, False, blnErrorIsFatal)
If blnErrorIsFatal Then
'Exit Function
'// Nah, let's use it!
blnCollectionExists = True
End If
End If
End If
Next
'// Create the collection
Set objCollection = objConn.Get("SMS_Collection").SpawnInstance_()
strMsg = ""
strMsg = strMsg & "Create Collection object"
Call CheckError(strMsg, strMsg, "", True, False, blnErrorIsFatal)
If blnErrorIsFatal Then
Exit Function
End If
With objCollection
.Comment = strCollectionComment
.Name = strCollectionName
.OwnedByThisSite = True
If blnCollectionExists Then
strCollectionPath = .Path
strMsg = ""
strMsg = strMsg & "Get Collection Path property"
Else
strCollectionPath = .Put_
strMsg = ""
strMsg = strMsg & "Commit Collection object"
End If
Call CheckError(strMsg, strMsg, "", True, False, blnErrorIsFatal)
If blnErrorIsFatal Then
Exit Function
End If
End With
'// Get the automatically assigned collection ID for the new collection
Set objCollection = objConn.Get(strCollectionPath)
strMsg = ""
strMsg = strMsg & "Create new Collection object"
Call CheckError(strMsg, strMsg, "", True, False, blnErrorIsFatal)
If blnErrorIsFatal Then
Exit Function
End If
strMsg = ""
strMsg = strMsg & "Waiting 10 seconds for SCCM to catch up!"
Call Say(strMsg, False)
Call Sleep(10)
strCollectionID = objCollection.CollectionID
'strCollectionID = CStr(objCollection.Keys("CollectionID"))
'// Create the collection relationship
'// You could use the VerifyNoLoops method of the SMS_Collection class
'// if you want to ensure that you won't create a loop of collections
Set objCollectionRelation = objConn.Get("SMS_CollectToSubCollect" ).SpawnInstance_()
strMsg = ""
strMsg = strMsg & "Create Collection Relationship object"
Call CheckError(strMsg, strMsg, "", True, False, blnErrorIsFatal)
If blnErrorIsFatal Then
Exit Function
End If
With objCollectionRelation
.subCollectionID = strCollectionID
.parentCollectionID = strParentCollectionID
.Put_
strMsg = ""
strMsg = strMsg & "Commit Collection Relationship object"
Call CheckError(strMsg, strMsg, "", True, False, blnErrorIsFatal)
If blnErrorIsFatal Then
Exit Function
End If
End With
Set colResources = objConn.ExecQuery("Select * From SMS_R_UserGroup WHERE Name LIKE ""%" + strResourceName + "%""")
For Each objResource In colResources
strResourceUserGroupName = objResource.UserGroupName
If strResourceUserGroupName = strResourceName Then
strResourceID = objResource.ResourceID
End If
Next
'// You might want to handle the contingency of a user who is new to
'// the domain and hasn't been added to the list of SMS users yet
'// Create a direct collection rule for the user you just determined
Set objCollectionRule = objConn.Get("SMS_CollectionRuleDirect").SpawnInstance_()
strMsg = ""
strMsg = strMsg & "Create Collection Rule object"
Call CheckError(strMsg, strMsg, "", True, False, blnErrorIsFatal)
If blnErrorIsFatal Then
Exit Function
End If
With objCollectionRule
.ResourceClassName = "SMS_R_UserGroup"
.ResourceID = strResourceID
.RuleName = "ResourceID=" & strResourceID
End With
'// Add the rule to the collection
objCollection.AddMembershipRule objCollectionRule
strMsg = ""
strMsg = strMsg & "Create Collection Membership Rule object"
Call CheckError(strMsg, strMsg, "", True, False, blnErrorIsFatal)
If blnErrorIsFatal Then
Exit Function
End If
strCollectionIDPassBack = strCollectionID
CreateCollection = True
Set objCollection = Nothing
Set objCollectionRelation = Nothing
Set colResources = Nothing
Set objCollectionRule = Nothing
Set colCollections = Nothing
On Error Goto 0
End Function
Sub CheckError(ByVal strErrSource, ByVal strInfo, ByVal strIgnoreList, ByVal blnShowSuccess, ByVal blnUseInstallerError, ByRef blnIsFatal)
Dim strMessage
Dim intErrNbr
Dim intErrNbrHex
Dim strErrDescription
Dim arrIgnoreList
Dim intIgnoreIndex
Dim blnIgnoring
blnIgnoring = False
blnIsFatal = False
Err.Source = strErrSource
With Err
intErrNbr = CStr(.Number)
intErrNbrHex = CStr(Hex(.Number))
strErrDescription = .Description
If .Number = 0 Then
If blnShowSuccess Then
Call Say(strInfo & " succeeded.")
End If
.Clear
Exit Sub
End If
If Len(strErrDescription) > 0 Then
'// Now we find that MS can't even be bothered to end their sentences with full stops!
If Right(strErrDescription, 1) <> "." Then
If Right(strErrDescription, 1) = " " Then
strErrDescription = Left(strErrDescription, Len(strErrDescription) - 1)
End If
strErrDescription = strErrDescription & ". "
End If
End If
strMessage = ""
If blnUseInstallerError Then
If Not objInstaller Is Nothing Then
Set objInstallerError = objInstaller.LastErrorRecord
If Not objInstallerError Is Nothing Then
strMessage = strMessage & vbCRLF & objInstallerError.FormatText
End If
End If
Else
strMessage = strMessage & "Error: " & intErrNbr & " (Hex:" & intErrNbrHex & ")" & vbCRLF
Select Case intErrNbrHex
Case "80072030"
.Description = "There is no such object on the server."
Case "80071392"
.Description = "The object already exists."
Case Else
blnResult = LookUpError(intErrNbrHex, strErrDescription)
.Description = strErrDescription
End Select
If Len(.Description) > 0 Then
strMessage = strMessage & .Description & vbCRLF
End If
If .Source <> "CheckError" Then
strMessage = strMessage & "Source: " & .Source & vbCRLF
End If
'// We may want to ignore certain errors
If Len(strIgnoreList) > 0 Then
arrIgnoreList = Split(strIgnoreList, ",")
For intIgnoreIndex = 0 To UBound(arrIgnoreList)
If .Number = CLng(arrIgnoreList(intIgnoreIndex)) Then
blnIgnoring = True
.Clear
strMessage = strMessage & vbTAB & "** Script is set to IGNORE this error **" & vbCRLF
Exit For
End If
Next
End If
If Not blnIgnoring Then
'// We don't to repeat information
If Len(.Source) = 0 Then
If Len(strInfo) > 0 Then
strMessage = strMessage & strInfo & vbCRLF
End If
End If
End If
If Not blnIgnoring Then
.Source = "CheckError"
blnIsFatal = True
End If
If blnIsFatal Then
strMessage = vbCRLF & vbCRLF & vbTAB & vbTAB & "Fatal " & strMessage
End If
.Clear
Call Say(strMessage)
End If
End With
End Sub
Posted by:
JessicaD
14 years ago
Briggsm,
Microsoft does have an official Windows 7 Support Forum specifically for IT Pros located here http://social.technet.microsoft.com/Forums/en/category/w7itpro/ . It is supported by product specialists as well as engineers and support teams. You may want to also check the threads available there for additional assistance and guidance.
Jessica
Microsoft Windows Client Team
Microsoft does have an official Windows 7 Support Forum specifically for IT Pros located here http://social.technet.microsoft.com/Forums/en/category/w7itpro/ . It is supported by product specialists as well as engineers and support teams. You may want to also check the threads available there for additional assistance and guidance.
Jessica
Microsoft Windows Client Team
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.