Delete a DesktopGroup

本文提供了一个PowerShell脚本示例,用于从XenDesktop 5.x站点中删除桌面组及其相关对象。脚本首先收集指定桌面组内的桌面信息,并获取每台桌面的机器UID。之后将这些机器从桌面组中移除,并调整与该桌面组相关的访问策略规则。最后,脚本会删除所有与桌面组相关的授权策略规则及桌面组本身。

# —————————————————————————————————
#PowerShell sample script to delete a desktop group and related objects from a XenDesktop 5.x site
#
#Note: One or more required values must be specified below before executing the script.
#
#
#
#Version 1.0
#———————————————————————————————–

#Provide the following values before executing:

#The FQDN for the DDC and XML port, if not the default of 80
#Eg: ‘ddc01.domain.com:80’
$ddcAddress = ”

#The name of the desktop group to be removed
$desktopGroupName = ”

#End of variables
#******************************************************************
asnp Citrix.*

#Get a collection of the desktops in the desktop group
$desktops = Get-BrokerDesktop -DesktopGroupName $desktopGroupName -AdminAddress $ddcAddress

#Get the machine UIDs for each desktop
$machineUids = $desktops | ForEach {$_.MachineUid}

#Use the collection of machine UIDs to remove them from the desktop group
Remove-BrokerMachine -InputObject $machineUids -DesktopGroup $desktopGroupName -AdminAddress $ddcAddress

#Get the access policy rules with the desktop group as an included desktop group
$aprs = Get-BrokerAccessPolicyRule -IncludedDesktopGroup $desktopGroupName -AdminAddress $ddcAddress

#Loop through the access policy rules
ForEach ($apr in $aprs) {

#Determine if the desktop group is the only referenced by the rule
If ($apr.IncludedDesktopGroups.Length -eq 1) {

#The desktop group is the only one referencing this rule; remove the rule
Remove-BrokerAccessPolicyRule -Name $apr.Name -AdminAddress $ddcAddress
} ElseIf ($apr.IncludedDesktopGroups.Length -gt 1) {

#This rule is being applied to more than one desktop group
#Get a list of the desktop groups with the (target) desktop group removed
$dgs = $apr.IncludedDesktopGroups | Where-Object { $_.Name -ne $desktopGroupName}

#Set the access policy rule to use the updated desktop groups list (sans target desktop group)
Set-BrokerAccessPolicyRule -Name $apr.Name -IncludedDesktopGroups $dgs -AdminAddress $ddcAddress
}
}

#Get the desktop group object for the desktop group
$desktopGroup = Get-BrokerDesktopGroup -Name $desktopGroupName -AdminAddress $ddcAddress

#Get the entitlement policy rules applied to this desktop group
$eprs = Get-BrokerEntitlementPolicyRule -DesktopGroupUid $desktopGroup.Uid -AdminAddress $ddcAddress

#Remove each entitlement policy rule
ForEach ($epr in $eprs) {
Remove-BrokerEntitlementPolicyRule -Name $epr.Name -AdminAddress $ddcAddress
}

#Remove the desktop group
Remove-BrokerDesktopGroup -Name $desktopGroupName -AdminAddress $ddcAddress

General Information You can add external commands to each device on the map. E.g., execute the ping.exe utility or remote desktop, etc. In addition, the device parameters (like device address) will be entered automatically. This feature turns the Algorius Net Viewer into an effective tool for managing a computer network. Algorius Net Viewer contains large list of predefined external commands. Application makes a check at the first launch and enables only those commands which are available on a machine. You can hide, remove commands, or add a new command. Please, contact us if you need any additional external commands to be predefined. We are interested in it, and will try to add them in the next software version (for free). Configuring To configure external commands, select Commands→Configure from the device context menu. The Options window will appear: This window will allow you to add, edit, delete and group the external commands. You can also use available external commands as a basis for new one’s (external command duplicate option). There are built-in external commands which can’t be deleted or edited. They are located in Standard group by default. Checkbox next to external command of group of commands enables or disables its display in device context menu. You can drag an external command or group of commands with a mouse to another group. You can remove a command from a group in the same way. Pressing the Up (Ctrl+Up) or the Down →Ctrl+Down) buttons allows you to reorder external commands. Clicking the Add, Duplicate or Edit button will display the External Command window:
03-20
考虑柔性负荷的综合能源系统低碳经济优化调度【考虑碳交易机制】(Matlab代码实现)内容概要:本文围绕“考虑柔性负荷的综合能源系统低碳经济优化调度”展开,重点研究在碳交易机制下如何实现综合能源系统的低碳化与经济性协同优化。通过构建包含风电、光伏、储能、柔性负荷等多种能源形式的系统模型,结合碳交易成本与能源调度成本,提出优化调度策略,以降低碳排放并提升系统运行经济性。文中采用Matlab进行仿真代码实现,验证了所提模型在平衡能源供需、平抑可再生能源波动、引导柔性负荷参与调度等方面的有效性,为低碳能源系统的设计与运行提供了技术支撑。; 适合人群:具备一定电力系统、能源系统背景,熟悉Matlab编程,从事能源优化、低碳调度、综合能源系统等相关领域研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①研究碳交易机制对综合能源系统调度决策的影响;②实现柔性负荷在削峰填谷、促进可再生能源消纳中的作用;③掌握基于Matlab的能源系统建模与优化求解方法;④为实际综合能源项目提供低碳经济调度方案参考。; 阅读建议:建议读者结合Matlab代码深入理解模型构建与求解过程,重点关注目标函数设计、约束条件设置及碳交易成本的量化方式,可进一步扩展至多能互补、需求响应等场景进行二次开发与仿真验证。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值