首页 技术 正文
技术 2022年11月15日
0 收藏 846 点赞 2,657 浏览 2303 个字

執行CHGUSRPRF命令需要*SECADM 權限,但通常Security部門不允許Grant這個這麼大的權限,爲了達到目的,改用下面的方法

1. Create CL program

注意裏面一定要用MONMSG命令擋住所有錯誤,不然PC端連到AS400的QZRCSRVS job一旦沒有權限或者profile不對會無限產生MSGW的job

2. CRTCLPRGM with  USRPRF(*OWNER)

3. CHGOBJOWN this program to a profile(比如 QCRTUSR) with
*SECADM authority

4. EDTOBJAUT this program to allow only user profile to use it

5.使用cwbx.dll

            cwbx.StringConverter sc = new cwbx.StringConverter();
AS400System s = new AS400System();
s.Define("AS400HostName");
// s.IPAddress = ipStr;
s.UserID = Constants.ISERIES_USER_NAME;
s.Password = Constants.ISERIES_PASSWORD;
s.PromptMode = cwbcoPromptModeEnum.cwbcoPromptNever;
cwbx.Program p = new cwbx.Program();
cwbx.Command c = new Command();
p.system = s;
p.LibraryName = Constants.ISERIES_InfiniumCustomLibName;
p.ProgramName = Constants.ISERIES_ChangeUserProfileProgramName;
ProgramParameters paras = new ProgramParameters();
paras.Append("@USRPRF", cwbrcParameterTypeEnum.cwbrcInout, 10);
paras.Append("@PWD", cwbrcParameterTypeEnum.cwbrcInout, 10);
paras.Append("@ERRMSG", cwbrcParameterTypeEnum.cwbrcOutput, 500);
userProfileName = userProfileName.Trim();
string userProfile = string.Format("{0}{1}", userProfileName, new string(' ', (10 - userProfileName.Length)));
paras["@USRPRF"].Value = sc.ToBytes(userProfile);
paras["@PWD"].Value = sc.ToBytes(newPassword);
p.Call(paras);
msg = sc.FromBytes(paras["@ERRMSG"].Value).ToString();

6.注意,cwbx.dll只有32bit版本,沒有64bit版本

如果是IIS7,每個web application pool都可以設置Enable 32-bit Applications為true,但悲催的IIS6這個參數是全局性的,會影響到其他web application

To enable IIS 6.0 to run 32-bit applications on 64-bit Windows

1.

Open a command prompt and navigate to the %systemdrive%\Inetpub\AdminScripts directory.

2.

Type the following command:

cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 “true”

3.

Press ENTER.

按上面的命令可以設置該參數為true,但導致的後果就是IIS不再會使用64bit的.Net FrameWork,那些web application直接不能用了。

終結方法是另起一個web service,該web srevice放在允許32bit的IIS上,這樣就行了。

http://www.experts-exchange.com/OS/Miscellaneous/Q_26247446.html

Create CL program called CHANGEUSR

Log on as QSECOFR

Change CHANGEUSER *PGM object owner to QSECOFR using CHGOBJOWN command.

Change program to run under *OWNER authority using CHGPGM command.

EDTOBJAUT on the program and restrict *USE rights to all users that you want to be able to use the program (not *PUBLIC!).

Configuring IIS to Run 32-bit Applications on 64-bit Windows (IIS 6.0)

https://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/405f5bb5-87a3-43d2-8138-54b75db73aa1.mspx?mfr=true

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,047
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,530
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,380
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,157
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,790
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,872