搜尋此網誌

2011年4月27日 星期三

Delete Remote pc share folder with WMIC(利用WMIC取消遠端PC共用資料夾設定)

查詢遠端有什麼share folder

wmic /note:"test-pc"
share list
or
share list brief

wmic:root\cli>share list brief

Description  Name              Path
             Outlook Personal  C:\Documents and Settings\adminuser.INTRANET\Lo.....
遠端 IPC     IPC$
預設共用     D$                D:\
遠端管理     ADMIN$            C:\WINDOWS
預設共用     C$                C:\


看到想要刪除的share folder name。EX:Outlook Personal

wmic:root\cli>share where name="outlook personal" call delete
Execute (\\test-pc\ROOT\CIMV2:Win32_Share.Name="Outlook Personal")->delete() (Y/N/?)? Y
Method execution successful.
Out Parameters:
instance of __PARAMETERS
{
        ReturnValue = 0;

其它參考資訊
http://theinterw3bs.com/wiki/index.php?title=WMIC_Commands#Display_Shares
http://hi.baidu.com/99168/blog/item/2cb7580facf673276159f37c.html

3Com 4200G L2 switch設定心得

測試環境:

已有一部cisco L3 switch,目前加入一部3Com 4200G L2 switch,cisco上有設定vlan 10、vlan 20、vlan 30 ,當然3Com上也要設定一樣的vlan,互通啦。

做法:

將3Com接上有dhcp的網段,如此dhcp server會assign一個IP給3Com,這樣就可以利用putty設定之。
login name: admin password: xxxx


要這兩部vlan上各設定一個trunk port。

cisco:

我要設定Port 9
>en
>password xxxx

Switch# configure terminal
Switch(config)# interface gigabitethernet0/9
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk encapsulation dot1q
Switch(config-if)# end
Switch# write memory

設定完成可以利用下列指令檢查trunk狀態.

1.      顯示有關switchport 的配置
show interfaces gigabitethernet0/9 switchport

2.      顯示有關trunk的配置
show interfaces gigabitethernet0/9 trunk

3Com:
login name: admin password: xxxx

system
interface GigabitEthernet 1/0/1
port link-type trunk
port trunk permit vlan all
display this <--可看看這個Port的狀況。

create vlan:

system
vlan 10
vlan 20
vlan 30
以下設定vlan 20的port由第3 port to 第10 port
vlan 20
port GigabitEthernet 1/0/3 to GigabitEthernet 1/0/10

陸續將port指給其它的vlan。

設定一個vlan的IP,讓之後不用再dhcp,即可remote。
interface Vlan-interface 10
ip address 192.168.102.1 255.255.255.0
如此日後用上述IP即可連到這個sw。