thank you for your assistance.
The script works. All Organizational groups in "Users by Department" will be deleted.
But the problem is that the Organizational group in Users for Department will not be created after a new reimport of the users from active directory. I will get following warning message in the log viewer when I reimport the users (for every user one message):
Log File Name: C:\ProgramData\Symantec\SMP\Logs\a.log
Priority: 2
Date: 2/8/2012 9:43:01 AM
Tick Count: 800156
Host Name: NSSERVER
Process: AeXSvc (1244)
Thread ID: 55
Module: AeXSVC.exe
Source: Altiris.NS.ResourceManagement.Database.DataLoaderSqlClientInserter.ExecuteBatch
Description: Failed to insert row into table ( INSERT INTO dbo.[Evt_Resource_Merge] ([_ResourceGuid],[Resource1Guid],[MergeDate],[Resource2Guid],[_eventTime]) VALUES (N'USERNAME (fe35fb6e-9d5e-4660-97d9-a957061536b9)',N'00000000-0000-0000-0000-000000000000',N'1/1/0001 12:00:00 AM',N'00000000-0000-0000-0000-000000000000',N'2012-02-08 09:43:01.310') ) Line Error: System.Data.SqlClient.SqlError: The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value.
**CEDUrlStart** :http://entced.symantec.com/entt?product=SMP&version=7.1.8280.0&language=en&module=qEPgIkM+lsiAeLHrNINNL9D6AgEJoSSmuS0Qo7WlSzor2vhOVUBUibOorcXjridC&error=-52648456&build=**CEDUrlEnd**
( )
( Exception logged from:
at Altiris.Diagnostics.Logging.EventLog.ReportException(Int32 severity, String strMessage, String category, Exception exception)
at Altiris.NS.Logging.EventLog.ReportException(Int32 severity, String strMessage, String category, Exception exception)
at Altiris.NS.ResourceManagement.Database.DataLoaderSqlClientInserter.ExecuteBatch(SqlCommand command, DatabaseContext context, String batch, List`1 lines)
at Altiris.NS.ResourceManagement.Database.DataLoaderSqlClientInserter.CommitBatch()
at Altiris.NS.ResourceManagement.Database.SqlClientInserter.CommitAll()
at Altiris.NS.ResourceManagement.DataClassRowCollection.InternalTableInserterImpl(IDataLoaderConnection connection, Hashtable resourceDLInfoHT, TargetTable targetTable, String strInserterTable, DataClass dataClass, DataClassRows dataClassRows)
at Altiris.NS.ResourceManagement.DataClassRowCollection.InternalTableInserter(IDataLoaderConnection connection, Hashtable resourceDLInfoHT, TargetTable targetTable, String strInserterTable, DataClass dataClass, DataClassRows dataClassRows)
at Altiris.NS.ResourceManagement.DataClassRowCollection.UpdateDataClass_Impl(DataClass dataClass, DataClassRows rows, Hashtable resourceDLInfoHT, Boolean HistoryEnabled, Hashtable resourceGuidToResourceTypeGuid, IDataLoaderConnection connection)
at Altiris.NS.ResourceManagement.DataClassRowCollection.<>c__DisplayClassa.<UpdateDataClass>b__6(IDatabaseContext context)
at Altiris.Database.DatabaseContext`1.PerformWithDeadlockRetryHelper(Int32 retries, Boolean inTransaction, Getter`1 getContext, Action`1 action, Action`1 retry)
at Altiris.Database.DatabaseContext`1.PerformWithDeadlockRetry(Int32 retries, Boolean startNewTransaction, IsolationLevel isolationLevel, Boolean independentContext, Action`1 action, Action`1 retry)
at Altiris.Database.DatabaseContext`1.PerformWithDeadlockRetry(Int32 retries, Boolean startNewTransaction, Action`1 action, Action`1 retry)
at Altiris.NS.ResourceManagement.DataClassRowCollection.UpdateDataClass(DataClass dataClass, DataClassRows rows, Hashtable resourceDLInfoHT, Boolean HistoryEnabled, Hashtable resourceGuidToResourceTypeGuid, IDataLoaderConnection connection)
at Altiris.NS.ResourceManagement.DataClassRowCollection.CommitData_Impl(IDataLoaderConnection connection)
at Altiris.NS.ResourceManagement.DataClassRowCollection.<>c__DisplayClass4.<CommitData>b__0(IDatabaseContext context)
at Altiris.Database.DatabaseContext`1.PerformWithDeadlockRetryHelper(Int32 retries, Boolean inTransaction, Getter`1 getContext, Action`1 action, Action`1 retry)
at Altiris.Database.DatabaseContext`1.PerformWithDeadlockRetry(Int32 retries, Boolean startNewTransaction, IsolationLevel isolationLevel, Boolean independentContext, Action`1 action, Action`1 retry)
at Altiris.Database.DatabaseContext`1.PerformWithDeadlockRetry(Int32 retries, Boolean startNewTransaction, Action`1 action, Action`1 retry)
at Altiris.NS.ResourceManagement.DataClassRowCollection.CommitData(IDataLoaderConnection connection)
at Altiris.NS.ResourceManagement.DataClassImporter.CommitData(ImmutableDataRowCacheTransaction imu, DataClassRowCollection rows)
at Altiris.NS.ResourceManagement.DataClassImporter.ProcessData(DataClass dataClass, XmlReader reader, Guid resourceGuidOverride, ProcessingDirective processingDirective)
at Altiris.NS.ResourceManagement.DataClassImporter.LoadInventory_Impl(XmlReader reader, Boolean bProcessData, Boolean bForceSchemaValidation, Guid resourceGuidOverride)
at Altiris.NS.ResourceManagement.DataClassImporter.LoadInventory(XmlReader reader)
at Altiris.NS.StandardItems.Messaging.InventoryCaptureItem.OnMessage_Impl(String message, Boolean useFilename)
at Altiris.NS.StandardItems.Messaging.InventoryCaptureItem.OnMessageInternal(String message, Boolean useFilename)
at Altiris.NS.ClientMessaging.EventQueueDispatcher.Dispatch(String message, Boolean useFilename)
at Altiris.NS.ClientMessaging.EventQueueDispatcher.PerformDispatch(DispatchSlot slot)
at Altiris.NS.ClientMessaging.EventQueueDispatcher.DispatchSingleNSE(DispatchSlot slot)
at Altiris.NS.ClientMessaging.EventQueueDispatcher.WorkerLoop(Object deliverySlot)
at System.Threading.ThreadHelper.ThreadStart(Object obj)
)
( )
So this is not a suitable solution. How can I reimport the Users so that the "Users by Department" will be filled?