Before connecting to the SMS Provider for a local or remote SMS site server, you first need to locate the SMS Provider for the site server. The SMS Provider can be either local or remote to the SMS site server you are using. The WMI class SMS_ProviderLocation is present on all SMS site servers, and one instance will contain the location for the SMS site server you are using.
You can connect to the SMS Provider on an SMS site server by using the WMI <linktext xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5"></linktext>SWBemLocator object or by using the Windows Script Host GetObject method. Both approaches work equally well on local or remote connections, with the following limitations:
- You must use SWbemLocator if you need to pass user credentials to a remote computer.
- You cannot use SWBemLocator to explicitly pass user credentials to a local computer.
There are several different syntaxes that you can use to make the connection, depending on whether the connection is local or remote. The following procedures provide two common variations. After you are connected to the SMS Provider, you will have an <linktext xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5"></linktext>SWBemServices object that you use to access SMS objects.
To connect to an SMS Provider by using SWbemLocator
-
<content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5"></content>
Connect to the local SWbemLocator object:
set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator") |
-
<content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5"></content>
Connect to a known SMS site server. If the computer name is a remote computer, you can pass the user name and password. Alternatively, you can authenticate using the current user's credentials by removing the user name and password parameters. If the computer name is the local computer, you must remove the user name and password because these will not be accepted. You can also change the computer name to "." if you want to connect to the local computer.
set objSWbemServices= objSWbemLocator.ConnectServer _ ("ComputerName", "root/sms","username","password") |
-
<content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5"></content>
Locate the SMS Provider for the SMS site by inspecting the SMS_ProviderLocation WMI class. For the SMS_ProviderLocation instance where the ProviderForLocalSite property is true, the object's Machine and SiteCode properties give the location of the SMS Provider for the SMS site server you are connected to. If the account running the script on the local computer has appropriate privileges, the user name and password parameters can be omitted.
Set ProviderLoc = objSWbemServices.InstancesOf("SMS_ProviderLocation")For Each Location In ProviderLoc If Location.ProviderForLocalSite = True Then Set objSWbemServices = objSWbemLocator.ConnectServer _ (Location.Machine, "root/sms/site_" + Location.SiteCode,"username","password") End IfNext |
-
<content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5"></content>
Continue using the objSWbemServices object to access SMS objects.
To connect to a remote SMS Provider by using the GetObject method
-
<content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5"></content>
Connect to a known SMS site server by using GetObject. In this example, authentication is set to impersonate. If you are connecting to the local computer, you can change SERVERNAME to ".".
Set objSWbemServices = GetObject("winmgmts:{impersonationLevel=impersonate}!//SERVERNAME/root/sms/site_SITECODE")if err.number0 then wscript.echo "WBemServices connection failed" wscript.quitend if |
-
<content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5"></content>
Continue using the objSWbemServices object to access SMS objects.
Security
<content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5"></content>
Using script to pass the user name and password is a security risk and should be avoided where possible.
<iframe align="center" marginwidth="0" marginheight="0" src="http://www.zealware.com/csdnblog.html" frameborder="0" width="728" scrolling="no" height="90"></iframe>
分享到:
相关推荐
将sms.dll文件拷贝到系统安装目录中的system32文件夹中,然后再根据以下接口函数说明和提供的例程源码开发 接口函数: 1、Sms_Connection(Com_Port As Integer,Com_BaudRate As Integer, Mobile_Type As String)...
将sms.dll文件拷贝到系统安装目录中的system32文件夹中,然后再根据以下接口函数说明和提供的例程源码开发 接口函数: 1、Sms_Connection(Com_Port As Integer,Com_BaudRate As Integer, Mobile_Type As String)...
Microsoft SMS 2003 客户能够借助面向 SMS 的英特尔 AMT 插件,充分利用采用英特尔:registered: 博锐:trade_mark: 技术的个人电脑中强大的可管理特性。凭借这些硬件功能,即使电脑关机或操作系统无法使用,IT 管理员...
function Sms_Send(Sms_TelNum:string;Sms_Text:string):integer;stdcall;external 'sms.dll'; Function Sms_Receive(Sms_Type:string;var Sms_Text:PChar):integer;stdcall;external 'sms.dll'; function Sms_...
将sms.dll文件拷贝到系统安装目录中的system32文件夹中,然后再根据以下接口函数说明和提供的例程源码开发 接口函数: 1、Sms_Connection(Com_Port As Integer,Com_BaudRate As Integer, Mobile_Type As String)...
smsapi-pl 针对node.js的SMSAPI.pl的实现使用此程序包,您可以轻松地通过波兰提供程序发送SMS 0.2.0版消息: 添加发送承诺用法: $npm install smsapi-pl然后: var sms = require ( 'smsapi-pl' ) ; 您可以放入sms...
Sms_Connection:返回值(0:连接终端失败;1:连接终端成功) 2、Sms_Send(Sms_TelNum As String, Sms_Text As String) As Integer Sms_Send函数说明如下: 功能描述:发送短信 Sms_TelNum:发送给的终端号码 ...
将sms.dll 文件拷贝到系统安装目录中的system32 文件夹中,然后再根据以下接口函数说明和提供的例 程源码开发 接口函数: 1、Sms_Connection(Com_Port As Integer,Com_BaudRate As Integer, Mobile_Type As String) ...
将sms.dll 文件拷贝到系统安装目录中的system32 文件夹中,然后再根据以下接口函数说明和提供的例 程源码开发 接口函数: 1、Sms_Connection(Com_Port As Integer,Com_BaudRate As Integer, Mobile_Type As String) ...
Laravel 包提供 SMS API 集成。 可以使用任何提供 REST API 的 SMS 供应商。 回购以显示支持 :smiling_face_with_smiling_eyes: 安装 安装包 需要 Composer 这个包: composer require gr8shivam/laravel-sms-api...
将sms.dll文件拷贝到系统安装目录中的system32文件夹中,然后再根据以下接口函数说明和提供的例程源码开发 接口函数: 1、Sms_Connection(Com_Port As Integer,Com_BaudRate As Integer, Mobile_Type As String)...
Nexmo SMS动作 使用从发送短信。 用法 name : Push to master on : [push] jobs : send - sms : name : Send SMS runs - on : ubuntu - latest steps : - name : Send SMS uses : nexmo - community / nexmo -...
亿美短信发送SDK
VC++:SMS短信测试: 实现短信的收发,
一个Perl模块,用于通过各种协议(SOAP,XML,HTTP和FTP)访问Clickatell批量SMS服务(http://www.Clickatell.com)。
赠送jar包:aliyun-sms-spring-boot-starter-2.0.2.jar 赠送原API文档:aliyun-sms-spring-boot-starter-2.0.2-javadoc.jar 赠送源代码:aliyun-sms-spring-boot-starter-2.0.2-sources.jar 包含翻译后的API文档...
微软 SMS2003 教程 SMS 教程 PDF SMS内部资料 SMS部署详解 SMS部署方法 sms手册
Easy SMS: 发送短信最简单的方法
方法该模块定义了以下功能:连接(回调) 连接插座认证() 获得 CHT 服务器的授权发送(目标编号,消息) 立即向目标号码发送消息。活动已登录:身份验证成功时login_failed: 身份验证失败已发送:发送的消息
java开发sms的资料大全:包含源码和sms、短信猫的相关资料,很全。