2.listopadu 2010

PC a internet Změna domovské složky uživatelů v AD

Při nedávné migraci jsem potřeboval změnit všem uživatelům v AD jejich domovskou složku - konkrétně tedy změnit jméno serveru, na které se domovské složky nacházeli.

Zde je zdrojový kód scriptu, který jsem na to použil:

Dim strComputer
Dim objWMI
Dim colUsers
Dim objUser
Dim homedirectory
Dim oldserver
Dim newserver


' Active Directory Computer
strComputer = "DC.example.local"

' Old home server
oldserver= "oldserver.example.local"

' New home server
newserver= "newserver.example.local"


' Select all user account
' ----------------------------------------------------------------

Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\directory\LDAP")

Set colUsers = objWMI.ExecQuery("SELECT * FROM ds_user")
   
For Each objUser in colUsers
  homedirectory=objUser.ds_homedirectory
  if instr(homedirectory,oldserver)>0 then
    homedirectory=replace(homedirectory, oldserver, newserver)
    changedir objUser.DS_distinguishedname, homedirectory         
  end if
Next


set colUsers=nothing
set objWMI=nothing


' FUNCTIONS
' ----------------------------------------------------------------


' Set Home directory pro AD user
' ----------------------------------------------------------------

sub changedir(dn, dir)
  Set objUser = GetObject("LDAP://" & dn)
  objUser.Put "homeDirectory", dir
  objUser.SetInfo
  set objuser=nothing
end sub

Ke stažení je k dispozici zde.


Hledáte-li správce sítě nebo prostě nekoho kdo umí spravovat servery, hledejte na www.petr-hladis.cz

Přečteno: 2649x | Komentářů: 32x | Kategorie: PC a internet

Komentáře čtenářů

1. GRAVATAR - plaubbida@benjaminmail.xyzplaubbida28. 10. 2022 23:05:00
Last November, the US Department of Energy invested 452 million in a Charlotte, N <a href=https://stromectol.autos/>ivermectin vs stromectol</a>
2. GRAVATAR - Quexerolo@benjaminmail.xyzQuexerolo10. 11. 2022 9:17:00
Pioneering works showing that ovariectomized and ERα deficient mice were unable to develop mammary gland at puberty have indicated that signaling through estrogens is crucial for the post natal mammary development 9, 10, 11, 12 <a href=https://nolvadex.one/>pct nolvadex</a>

Reklama ETARGET:

3. GRAVATAR - Zootthory@newonlinemail.xyzZootthory13. 11. 2022 15:50:00
They are aimed towards rapidly multiplying cells <a href=http://priligy.me/>priligy prescription</a> I try to be mindful of this and keep moving
4. GRAVATAR - addedetem@mailuk.siteaddedetem14. 11. 2022 10:56:00
Because there are multiple studies suggesting that HRT, particularly combined with estrogen progesterone use, increases risk of breast cancer, 12 there is legitimate concern that HRT may offset the breast cancer risk reduction conferred by BPO <a href=https://clomid.mom/>is clomiphene the same as clomid</a>
5. GRAVATAR - Slaldycle@topmailnew.xyzSlaldycle16. 11. 2022 16:26:00
Where Can You Buy Royal Blend Cbd Gummies <a href=https://doxycycline.world/>buy doxycycline</a>
6. GRAVATAR - duchthusy@barrettmail.xyzduchthusy23. 11. 2022 12:03:00
Wahl; Sankt Veit Hospital, Sankt Veit J <a href=http://lasix.autos/>lasix 20 mg</a> Microglia are resident parenchymal macrophages in the central nervous system CNS
7. GRAVATAR - stirutt@newonlinemail.xyzstirutt23. 11. 2022 16:21:00
<a href=http://stromectol.ink/>stromectol prix</a> Other medications can affect the removal of clarithromycin from your body, which may affect how clarithromycin works

Reklama ETARGET:

8. GRAVATAR - basergy@benjaminmail.xyzbasergy10. 12. 2022 16:20:00
<a href=http://clevitras.monster>levitra 20mg club</a> Pls have put this blog
9. GRAVATAR - ELomonnem@benjaminmail.xyzELomonnem12. 12. 2022 10:19:00
ciloxan augmentin 400 57 prospect â <a href=https://propecia.hair>finasteride buy online</a>
10. GRAVATAR - swammic@bernardmail.xyzswammic13. 12. 2022 3:25:00
These drugs seem to be effective in reducing risk of ER positive cancers, but do not impact the occurrence of ER negative cancers, said Bernstein <a href=http://accutane.one>how to get accutane</a> These transcribed medical transcription sample reports may include some uncommon or unusual formats; this would be due to the preference of the dictating physician
11. GRAVATAR - Idiomia@barrettmail.xyzIdiomia16. 12. 2022 2:13:00
Rafael Perera, Emily McFadden, Julie McLellan, Tom Lung, Philip Clarke, Teresa PĂ©rez, Thomas Fanshawe, Andrew Dalton, Andrew Farmer, Paul Glasziou, Osamu Takahashi, John Stevens, Les Irwig, Jennifer Hirst, Sarah Stevens, Asuka Leslie, Sachiko Ohde, Gautam Deshpande, Kevin Urayama, Brian Shine, and Richard Stevens <a href=https://nolvadex.lol>tamoxifen weight gain</a> This was BS and the last thing a doctor should say to a depressed person
12. GRAVATAR - opporia@newonlinemail.xyzopporia17. 12. 2022 3:44:00
The testicular atrophy that occurs is not permanent but will reverse once steroid use is discontinued and natural testosterone production begins again <a href=http://clomids.icu>clomid 50mg</a>

Reklama ETARGET:

13. GRAVATAR - trobrehek@baileymail.xyztrobrehek25. 1. 2023 6:37:00
The pilot Blood Pressure in Dialysis study randomized patients on hemodialysis to a standardized or intensive predialysis systolic BP target achieved systolic BP approximately 156 mm Hg versus approximately 145 mm Hg, respectively, and found no difference in left ventricular mass, but more IDH and adverse cardiovascular events in the intensive BP lowering group 22 <a href=https://propecia.bond>buy cheap propecia</a>
14. GRAVATAR - Ephetly@newtopmail.xyzEphetly26. 1. 2023 2:07:00
<a href=http://cialis.makeup>buy cialis online without prescription</a> Monitor Closely 1 tecovirimat will decrease the level or effect of dapsone by affecting hepatic intestinal enzyme CYP3A4 metabolism
15. GRAVATAR - undissize@mailuk.siteundissize26. 1. 2023 5:40:00
A FOBT or FIT done during a digital rectal exam in the doctor s office is not adequate for screening <a href=http://cialisshop.best>cialis otc</a>
16. GRAVATAR - Soorymn@bernardmail.xyzSoorymn28. 1. 2023 19:52:00
The non IgE mediated reactions are usually induced by low molecular weight substances such as a whole series of drugs, some food additives, other chemicals or agents, fMLP, complement factor C5a, etc <a href=https://acialis.top>cialis online without prescription</a>
17. GRAVATAR - teerhearm@barrymail.xyzteerhearm29. 1. 2023 9:17:00
Also, if children seem to be having trouble in school, problems with reading, rubbing their eyes when reading, etc <a href=https://cialis.boats>cheap cialis</a>

Reklama ETARGET:

18. GRAVATAR - sonoinsig@beaumail.xyzsonoinsig29. 1. 2023 11:34:00
Those with polypharmacy had a higher median comorbidity count on both admission and discharge and higher prevalence of functional impairment upon admission <a href=https://priligy.buzz>dapoxetine priligy uk</a>
19. GRAVATAR - pogiese@topnewmail.xyzpogiese31. 1. 2023 6:08:00
Like women and girls, guys too can get breast lumps, but it is rare <a href=http://brandcialis.best>buy cialis online with a prescription</a> Mucus rheology logarithm of G, rigidity factor at 1 and 100 radians s 1, frequency of deformation was evaluated in each group at time 0, 1 and 2 h
20. GRAVATAR - teerhearm@barrymail.xyzteerhearm31. 1. 2023 11:28:00
<a href=http://nolvadex.best>online pharmacy india tamoxifen 20 mg</a> Multiple gestations put the mother and baby at increased risk of adverse outcomes, including premature birth
21. GRAVATAR - sonoinsig@beaumail.xyzsonoinsig31. 1. 2023 13:35:00
<a href=https://cialisshop.best>buy cialis uk</a> Zhao Ling tried im 16 and my penis has not grown many methods, but in the end he could only choose to give up
22. GRAVATAR - Sogalgowl@onymail.xyzSogalgowl2. 2. 2023 0:23:00
53 Patients with nephrotic syndrome who are on exogenous thyroid hormone replacement may need an increase in their levothyroxine dose to maintain a euthyroid state <a href=http://propecia.skin>finasteride sample</a>

Reklama ETARGET:

23. GRAVATAR - broorgowl@newonlinemail.xyzbroorgowl5. 2. 2023 12:31:00
I m 42, and not even a little bit menopausal yet <a href=https://brandviagra.top>can i get viagra over the counter</a> Then, the total anticholinergic scores were calculated based on the sum of the scores of each medication the subject received
24. GRAVATAR - tipelinna@baileymail.xyztipelinna10. 2. 2023 21:12:00
Clonidine is an excellent drug but has side effects such as fatigue, sleepiness, and dry mouth making it a second or third line choice <a href=https://clomid.homes>clomid medication</a>
25. GRAVATAR - Doloblirl@bernardmail.xyzDoloblirl16. 2. 2023 10:44:00
<a href=https://stromectol.one>stromectol 6 mg</a> Control cells transfected with cmv
26. GRAVATAR - unsenia@barrettmail.xyzunsenia18. 2. 2023 5:11:00
<a href=http://clomid.buzz>clomid mechanism of action</a> Some vitamins have been known to have a negative effect on the body as vitamins have a balance between their With online pharmacies, doctors are able to ensure that your Lasix is provided in an amount that is necessary for your health needs
27. GRAVATAR - kanteekal@bernardmail.xyzkanteekal26. 2. 2023 1:37:00
Skinner HG, Michaud DS, Giovannucci E, Willett WC, Colditz GA, Fuchs CS <a href=http://buycialis.lol>where to buy cialis online safely</a>

Reklama ETARGET:

28. GRAVATAR - Beriloolo@onymail.xyzBeriloolo6. 3. 2023 2:24:00
There was no significant correlation between the plasma testosterone values and the length of the cycle, the duration of the follicular phase, the duration of the rise in basal temperature or the length thereof <a href=https://buycialis.boats>cialis 5mg online</a>
29. GRAVATAR - saicuro@newonlinemail.xyzsaicuro9. 3. 2023 1:32:00
Make sure you get bloods man especially with SARMS <a href=http://buycialis.homes>cialis</a> I personally do not think you need more than 8 weeks off total but I m pretty liberal in my thinking on this
30. GRAVATAR - IrocHus@cmaill.xyzUlcenly16. 5. 2023 16:41:00
<a href=https://vardenafil.top>cialis via michelin levitra</a> s possession citing a draft report by the Pentagonâ
31. GRAVATAR - Drieprilm@cmaill.xyzZkfrirZYp27. 7. 2023 18:51:00
<a href=http://cialiss.makeup>buy cialis online from india</a> Gerard J Gianoli, MD Clinical Associate Professor, Department of Otolaryngology Head and Neck Surgery, Tulane University School of Medicine; Vice President, The Ear and Balance Institute; Chief Executive Officer, Ponchartrain Surgery Center
32. GRAVATAR - Drieprilm@cmaill.xyzuPEztp1. 9. 2023 9:38:00
Estradiol can elevate in men who discontinueTRT so it is important to run the SERM for some time after discontinuing TRT to mitigate E2 rebound <a href=https://atadalafil.mom>buy liquid cialis online</a> After an exhaustive search of the literature, only 3 studies of body size and breast cancer were conducted in Hispanic women were identified, and only 8 such studies in African American women were identified

Reklama ETARGET:


Přidat vlastní komentář k článku



Z důvovů ochrany proti spamu prosím do následujícího políčka napište texy "NOSPAM":

Chcete-li ke komentáři přidat svou fotku nebo jinou ikonku, postupujte podle návodu.


TOPlist

[CNW:Counter]