Windows 云服务器桌面显示服务器信息的需求,腾讯云以前的镜像里有,有些客户需要,有些客户不需要,后来去掉了,有需要的可以使用这个.zip解压到C:Program FilesQCloudbginfo然后双击"C:Program FilesQCloudbginfoget_meta.exe"实现
1、copy .zip to cvm ,unzip to "C:Program FilesQCloudbginfo",must be "C:Program FilesQCloudbginfo",other path will not work
bginfo.exe from:https://learn.microsoft.com/zh-cn/sysinternals/downloads/bginfo
bginfo.zip from:http://windows-1251783334.cos.ap-shanghai.myzijiebao.com/bginfo.zip
2、double click "C:Program FilesQCloudbginfoget_meta.exe"
注意,必须是C:Program FilesQCloudbginfo 、"C:Program FilesQCloudbginfoget_meta.exe"
换其他路径无效,估计写死路径了
如果你自己获取实例信息的话,可以参考下面的办法
腾讯云
代码语言:javascript复制#查看实例元数据 https://cloud.tencent.com/document/product/213/4934
#cvm实例ID
$instanceid=(Invoke-WebRequest 'http://169.254.0.23/latest/meta-data/instance-id' -UseBasicParsing).Content
#cvm外网IP(如果需要内网IP,url里的public-ipv4换成local-ipv4)
$ip=(Invoke-WebRequest 'http://169.254.0.23/latest/meta-data/public-ipv4' -UseBasicParsing).Content
#查看cvm uuid
$uuid=(Invoke-WebRequest 'http://169.254.0.23/latest/meta-data/uuid' -UseBasicParsing).Content
#获取硬盘实例id
(Invoke-WebRequest 'http://169.254.0.23/meta-data/volumes/' -UseBasicParsing).Content > c:diskidtmp.txt
$disk0id=(Get-Content c:diskidtmp.txt | Select -Index 0).split("/")[0]
$disk1id=(Get-Content c:diskidtmp.txt | Select -Index 1).split("/")[0]
#获取实例机型
$instancetype=(Invoke-WebRequest 'http://169.254.0.23/meta-data/instance/instance-type' -UseBasicParsing).Content
#获取实例镜像ID
$imageid=(Invoke-WebRequest 'http://169.254.0.23/meta-data/instance/image-id' -UseBasicParsing).Content
#获取实例账号appid
$appid=(Invoke-WebRequest 'http://169.254.0.23/meta-data/app-id' -UseBasicParsing).Content
$instanceid
$ip
$uuid
$disk0id
$disk1id
$instancetype
$imageid
$appid
阿里云
代码语言:javascript复制#查看实例元数据 https://help.aliyun.com/zh/ecs/user-guide/use-instance-identities
$instanceid=(Invoke-WebRequest 'http://100.100.100.200/latest/meta-data/instance-id' -UseBasicParsing).Content
$ip=(Invoke-WebRequest 'http://100.100.100.200/latest/meta-data/eipv4' -UseBasicParsing).Content
$uuid=(Invoke-WebRequest 'http://100.100.100.200/latest/meta-data/hostname' -UseBasicParsing).Content
$disk0id=(get-disk|where {$_.Number -eq 0}).SerialNumber
$disk1id=(get-disk|where {$_.Number -eq 1}).SerialNumber
$instancetype=(Invoke-WebRequest 'http://100.100.100.200/latest/meta-data/instance/instance-type' -UseBasicParsing).Content
$imageid=(Invoke-WebRequest 'http://100.100.100.200/latest/meta-data/image-id' -UseBasicParsing).Content
$appid=(Invoke-WebRequest 'http://100.100.100.200/latest/meta-data/owner-account-id' -UseBasicParsing).Content
$instanceid
$ip
$uuid
$disk0id
$disk1id
$instancetype
$imageid
$appid