PowerShell - 新建outlook 联系人
$comments = @'
9 K- q7 j( ?- J. ^- g: U% sScript name: Create-Contact.ps1
+ Q- y& ]: M- ~- c: BCreated on: Thursday, July 19, 20070 g0 l! b- [3 x7 i7 k1 T
Author: Kent Finkle4 l) {0 z7 r$ }& \* Q
Purpose: How can I use Windows Powershell to
/ w' m5 v# Q8 I: U6 M0 y" s& }( S" w4 tCreate a New Contact in Microsoft Outlook?
& O" o) H. u! V'@
% O) W6 ~) \; }2 n) @0 {. \ 0 K, Z1 t( M5 W- ^7 w7 g' [
$olContactItem = 24 K; h1 \2 F. f+ [! i3 y, `
2 n' E+ ]( H* d
$o = new-object -comobject outlook.application
& m1 H. ^% R l- j+ w, A! {) i8 ]
$c = $o.CreateItem($olContactItem)/ @ {1 H3 u7 z- {
, ]' i2 M) f5 u1 e; O% ^. ^9 w/ w
$c.FullName = "Ken Myer"
" b y4 `3 s% t6 o8 G- ~$c.Email1Address = "kenmyer@fabrikam.com"4 k6 X" S" {0 ?2 y
$c.CompanyName = "Fabrikam"7 ^9 ]% C9 h' b4 U4 J
$c.JobTitle = "Network Administrator"
+ T9 g3 `+ x- ?& e7 q( E$c.HomeTelephoneNumber = "555-555-8888"3 d! Q8 n; j: z) m/ w g, Y
$c.HomeAddress = "3725 205th NE`n" + "Redmond, WA 98052"7 y, {4 [* l1 R3 ]9 c
$c.Birthday = "9/15/1966"/ V' w$ x. e+ @: E
7 y+ G7 Z& h3 p3 M1 S8 P$a = $c.Save()